Skip to content

Commit

Permalink
Turn on new worldSafeExecuteJavaScript webPreference.
Browse files Browse the repository at this point in the history
<electron/electron#24114>
"Previously the return values of webFrame.executeJavaScript crossed the world boundary when context isolation was enabled. This allows apps to makes themselves insecure by accidentally sending objects from the isolated world back to the main world. To help devs avoid this we're adding this new flag, and this flag will be turned on by default in Electron 12 (and removed) ensuring that this kind of issue can't become a thing again.

This PR is also requesting new minors of 8 and 9 😄

Notes: Added new worldSafeExecuteJavaScript webPreference to ensure that the return values from webFrame.executeJavaScript are world safe when context isolation is enabled"
  • Loading branch information
Paul Delhanty committed Aug 14, 2020
1 parent 281e471 commit ef87c9d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.ts
Expand Up @@ -26,7 +26,13 @@ function launch() {
height: 600,
minWidth: 600,
backgroundColor: 'white',
titleBarStyle: 'hidden'
titleBarStyle: 'hidden',
webPreferences: {
// Need `contextIslation` and `worldSafeExecuteJavaScript` both set
// to silence recent `webFrame.executeJavaScript` warnings.
contextIsolation: true,
worldSafeExecuteJavaScript: true
},
});

win.loadURL(
Expand Down

0 comments on commit ef87c9d

Please sign in to comment.