Merge pull request #1134 from psjostrom/devtools-environment-dependent

fix: Make devTools enabled dependent on if dev environment
This commit is contained in:
psjostrom 2020-12-04 14:19:22 +01:00 committed by GitHub
commit c4b1b35549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 23 deletions

View File

@ -896,9 +896,6 @@ export class WindowHandler {
resizable: false,
fullscreenable: false,
},
{
devTools: false,
},
);
if (
@ -1017,9 +1014,6 @@ export class WindowHandler {
resizable: false,
fullscreenable: false,
},
{
devTools: false,
},
);
if (
@ -1096,9 +1090,6 @@ export class WindowHandler {
show: false,
fullscreenable: false,
},
{
devTools: false,
},
);
const focusedWindow = BrowserWindow.getFocusedWindow();
if (focusedWindow && windowExists(focusedWindow) && isWindowsOS) {
@ -1207,9 +1198,6 @@ export class WindowHandler {
autoHideMenuBar: true,
resizable: false,
},
{
devTools: false,
},
);
opts.parent = window;
this.basicAuthWindow = createComponentWindow('basic-auth', opts);
@ -1266,9 +1254,6 @@ export class WindowHandler {
fullscreenable: false,
autoHideMenuBar: true,
},
{
devTools: false,
},
);
// This prevents creating multiple instances of the
// notification configuration window
@ -1382,9 +1367,6 @@ export class WindowHandler {
title: 'Screen Sharing Indicator - Symphony',
closable: false,
},
{
devTools: false,
},
),
...{ winKey: streamId },
};
@ -1493,9 +1475,6 @@ export class WindowHandler {
transparent: true,
alwaysOnTop: true,
},
{
devTools: false,
},
);
if (
@ -1832,7 +1811,7 @@ export class WindowHandler {
*/
private getWindowOpts(
windowOpts: Electron.BrowserWindowConstructorOptions,
webPreferences: Electron.WebPreferences,
webPreferences?: Electron.WebPreferences,
): ICustomBrowserWindowConstructorOpts {
const defaultPreferencesOpts = {
...{
@ -1840,6 +1819,7 @@ export class WindowHandler {
nodeIntegration: isNodeEnv,
contextIsolation: isNodeEnv ? false : this.contextIsolation,
backgroundThrottling: this.backgroundThrottling,
devTools: isDevEnv,
},
...webPreferences,
};

View File

@ -127,7 +127,7 @@ export const createComponentWindow = (
sandbox: !isNodeEnv,
nodeIntegration: isNodeEnv,
preload: path.join(__dirname, '../renderer/_preload-component.js'),
devTools: false,
devTools: isDevEnv,
},
};