diff --git a/app/main.dev.js b/app/main.dev.js index 7c570e4..dcd0ddb 100644 --- a/app/main.dev.js +++ b/app/main.dev.js @@ -216,7 +216,7 @@ const createWindow = function () { if (openNextFile) { openWarc(openNextFile); - } else if (process.argv.length > 1 && !process.argv[1].startsWith('-psn')) { + } else if (process.argv.length == 2 && !process.argv[1].startsWith('-psn')) { openWarc(process.argv[1]); } @@ -275,6 +275,17 @@ app.on('window-all-closed', () => { app.quit(); }); +// Ensure new-window urls are just opened directly in the webview +app.on('web-contents-created', (e, contents) => { + if (contents.getType() == 'webview') { + // Listen for any new window events on the webview + contents.on('new-window', (e, url) => { + e.preventDefault(); + contents.loadURL(url); + }) + } +}) + app.on('will-finish-launching', function() { app.on('open-file', function(event, filePath) {