diff --git a/electron/main.js b/electron/main.js index b99dc415..bae9e9e5 100644 --- a/electron/main.js +++ b/electron/main.js @@ -325,7 +325,6 @@ const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => { if (shouldQuit) { app.quit(); - return; } // Code for downloading images as temporal files @@ -471,3 +470,11 @@ app.on('activate', function () { app.on('before-quit', function () { isQuitting = true; }); + +// Prevent the ability to create webview with nodeIntegration. +app.on('web-contents-created', (event, contents) => { + contents.on('will-attach-webview', (event, webPreferences, params) => { + // Always prevent node integration + webPreferences.nodeIntegration = false; + }); +});