diff options
author | 2021-12-25 13:44:40 +0100 | |
---|---|---|
committer | 2021-12-25 13:44:40 +0100 | |
commit | 59d6f0e799670ec2ffae84c51090e28cf1264af0 (patch) | |
tree | 15a569efedadc0d37e2e73f7c74c869c7874c585 /packages/main/src/index.ts | |
parent | refactor: Fetch service inject asynchronously (diff) | |
download | sophie-59d6f0e799670ec2ffae84c51090e28cf1264af0.tar.gz sophie-59d6f0e799670ec2ffae84c51090e28cf1264af0.tar.zst sophie-59d6f0e799670ec2ffae84c51090e28cf1264af0.zip |
feat: Disable main window devtools in production
Diffstat (limited to 'packages/main/src/index.ts')
-rw-r--r-- | packages/main/src/index.ts | 6 |
1 files changed, 2 insertions, 4 deletions
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 { | |||
115 | } catch (_err) { | 115 | } catch (_err) { |
116 | return true; | 116 | return true; |
117 | } | 117 | } |
118 | if (normalizedUrl.startsWith('devtools:')) { | ||
119 | return false; | ||
120 | } | ||
121 | if (isDevelopment) { | 118 | if (isDevelopment) { |
122 | if (normalizedUrl.startsWith('chrome-extension:')) { | 119 | if (normalizedUrl.startsWith('devtools:') || normalizedUrl.startsWith('chrome-extension:')) { |
123 | return false; | 120 | return false; |
124 | } | 121 | } |
125 | if (import.meta.env.VITE_DEV_SERVER_URL !== undefined) { | 122 | if (import.meta.env.VITE_DEV_SERVER_URL !== undefined) { |
@@ -136,6 +133,7 @@ function createWindow(): Promise<unknown> { | |||
136 | show: false, | 133 | show: false, |
137 | autoHideMenuBar: true, | 134 | autoHideMenuBar: true, |
138 | webPreferences: { | 135 | webPreferences: { |
136 | devTools: isDevelopment, | ||
139 | sandbox: true, | 137 | sandbox: true, |
140 | preload: getResourcePath('../../preload/dist/index.cjs'), | 138 | preload: getResourcePath('../../preload/dist/index.cjs'), |
141 | }, | 139 | }, |