Enable context isolation (#999)
This commit is contained in:
@@ -355,6 +355,7 @@ function handleAppWillFinishLaunching() {
|
||||
function handleAppWebContentsCreated(dc, contents) {
|
||||
contents.on('will-attach-webview', (event, webPreferences) => {
|
||||
webPreferences.nodeIntegration = false;
|
||||
webPreferences.contextIsolation = true;
|
||||
});
|
||||
contents.on('will-navigate', (event, navigationUrl) => {
|
||||
const parsedUrl = new URL(navigationUrl);
|
||||
|
@@ -45,6 +45,7 @@ function createMainWindow(config, options) {
|
||||
fullscreen: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
webviewTag: true,
|
||||
},
|
||||
});
|
||||
@@ -71,6 +72,7 @@ function createMainWindow(config, options) {
|
||||
|
||||
mainWindow.webContents.on('will-attach-webview', (event, webPreferences) => {
|
||||
webPreferences.nodeIntegration = false;
|
||||
webPreferences.contextIsolation = true;
|
||||
});
|
||||
|
||||
mainWindow.once('ready-to-show', () => {
|
||||
|
Reference in New Issue
Block a user