From 59d6f0e799670ec2ffae84c51090e28cf1264af0 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sat, 25 Dec 2021 13:44:40 +0100 Subject: feat: Disable main window devtools in production --- packages/main/src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'packages/main') diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index b134002..22ae8e2 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts @@ -115,11 +115,8 @@ function shouldCancelMainWindowRequest(url: string, method: string): boolean { } catch (_err) { return true; } - if (normalizedUrl.startsWith('devtools:')) { - return false; - } if (isDevelopment) { - if (normalizedUrl.startsWith('chrome-extension:')) { + if (normalizedUrl.startsWith('devtools:') || normalizedUrl.startsWith('chrome-extension:')) { return false; } if (import.meta.env.VITE_DEV_SERVER_URL !== undefined) { @@ -136,6 +133,7 @@ function createWindow(): Promise { show: false, autoHideMenuBar: true, webPreferences: { + devTools: isDevelopment, sandbox: true, preload: getResourcePath('../../preload/dist/index.cjs'), }, -- cgit v1.2.3-54-g00ecf