diff --git a/main.js b/main.js index e1ca16e3..0ef14cea 100644 --- a/main.js +++ b/main.js @@ -76,6 +76,7 @@ function createWindow () { width: 800, height: 600, webPreferences: { + nodeIntegration: false, preload: path.join(__dirname, 'sentry.js') } }); @@ -117,8 +118,8 @@ function createWindow () { // Some APIs can only be used after this event occurs. app.on('ready', createWindow); -app.on('ready', createServerProc); -app.on('will-quit', exitServerProc); +// app.on('ready', createServerProc); +// app.on('will-quit', exitServerProc); // Quit when all windows are closed. app.on('window-all-closed', function () { diff --git a/sentry.js b/sentry.js index 14df2c57..dbf7059d 100644 --- a/sentry.js +++ b/sentry.js @@ -1,6 +1,7 @@ const { init } = require('@sentry/electron'); const fs = require('fs'); -const { ipcMain } = require('electron'); + +const { ipcRenderer } = require('electron') let crashReportsEnabled = true; const DSN = @@ -15,7 +16,7 @@ const shouldSendCallback = () => { }; -ipcMain.on('settings.changed', function (event, settings) { +ipcRenderer.on('settings.changed', function (event, settings) { crashReportsEnabled = settings.crash_reports; }); diff --git a/src/index.html b/src/index.html index 72379fa1..cdeb1b62 100644 --- a/src/index.html +++ b/src/index.html @@ -13,7 +13,7 @@ if (userAgent.indexOf(' electron/') > -1) { var base = document.getElementsByTagName('base'); if(base.length > 0) { - base.href ='./'; + base[0].href ='./'; } else { document.write('');