fix: warning when worldSafeExecuteJavaScript is disabled (#27928)
This commit is contained in:
parent
ede8611937
commit
bf7e445883
1 changed files with 4 additions and 2 deletions
|
@ -48,8 +48,10 @@ class WebFrame extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const { hasSwitch } = process._linkedBinding('electron_common_command_line');
|
const contextIsolation = binding.getWebPreference(window, 'contextIsolation');
|
||||||
const worldSafeJS = hasSwitch('world-safe-execute-javascript') && hasSwitch('context-isolation');
|
const worldSafeExecuteJavaScript = binding.getWebPreference(window, 'worldSafeExecuteJavaScript');
|
||||||
|
|
||||||
|
const worldSafeJS = worldSafeExecuteJavaScript || !contextIsolation;
|
||||||
|
|
||||||
// Populate the methods.
|
// Populate the methods.
|
||||||
for (const name in binding) {
|
for (const name in binding) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue