diff options
Diffstat (limited to 'electron_js/main.js')
| -rw-r--r-- | electron_js/main.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/electron_js/main.js b/electron_js/main.js index defa006d..a97eb01e 100644 --- a/electron_js/main.js +++ b/electron_js/main.js @@ -33,10 +33,10 @@ if (argv.lang) { // be closed automatically when the JavaScript object is garbage collected. let win; app.commandLine.appendSwitch ('ignore-certificate-errors', 'true'); -app.commandLine.appendArgument('no-sandbox'); - +console.log ('ignore certs'); const gotTheLock = app.requestSingleInstanceLock() +console.log ('single instance locks'); if (!gotTheLock) { app.quit() @@ -59,7 +59,7 @@ function newWindow() { function createAlternateWindow() { - + console.log ("new browser"); var newWin = new BrowserWindow({ x: 10, y: 10, @@ -68,12 +68,14 @@ function createAlternateWindow() { icon: path.join(__dirname, '/../resources/icon.png'), webPreferences:{nodeIntegration:false}}); + console.log ("startUrl"); const startUrl = process.env.ELECTRON_START_URL || url.format({ pathname: path.join(__dirname, '/../www/index.html'), protocol: 'file:', slashes: true }); + console.log ("new win"); newWin.loadURL(startUrl); } @@ -125,13 +127,13 @@ function createWindow() { - win.webContents.session.webRequest.onHeadersReceived({}, (d, c) => { + /* win.webContents.session.webRequest.onHeadersReceived({}, (d, c) => { if(d.responseHeaders['x-frame-options'] || d.responseHeaders['X-Frame-Options']){ delete d.responseHeaders['x-frame-options']; delete d.responseHeaders['X-Frame-Options']; } c({cancel: false, responseHeaders: d.responseHeaders}); - }); + });*/ mainWindowState.manage(win); @@ -291,6 +293,7 @@ app.on('activate', () => { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (win === null) { + console.log ("createWindow"); createWindow(); } }); @@ -300,7 +303,8 @@ process.on('uncaughtException', function (err) { console.log("***WHOOPS TIME****"+err); }); - + +console.log ("will-quit"); app.on('will-quit', () => { // Unregister all shortcuts. globalShortcut.unregisterAll() |
