diff options
Diffstat (limited to 'packages/main')
-rw-r--r-- | packages/main/src/index.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index f8b6787..c258481 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts | |||
@@ -72,6 +72,14 @@ app.commandLine.appendSwitch( | |||
72 | 'HardwareMediaKeyHandling,MediaSessionService', | 72 | 'HardwareMediaKeyHandling,MediaSessionService', |
73 | ); | 73 | ); |
74 | 74 | ||
75 | // It doesn't seem to cause a race condition to start installing the extensions this early. | ||
76 | if (isDevelopment) { | ||
77 | app.whenReady().then(installDevToolsExtensions).catch((err) => { | ||
78 | console.error('Failed to install devtools extensions', err); | ||
79 | process.exit(1); | ||
80 | }); | ||
81 | } | ||
82 | |||
75 | // Remove sophie and electron from the user-agent string to avoid detection. | 83 | // Remove sophie and electron from the user-agent string to avoid detection. |
76 | const originalUserAgent = app.userAgentFallback; | 84 | const originalUserAgent = app.userAgentFallback; |
77 | const userAgent = originalUserAgent.replaceAll(/\s(sophie|Electron)\/\S+/g, ''); | 85 | const userAgent = originalUserAgent.replaceAll(/\s(sophie|Electron)\/\S+/g, ''); |
@@ -305,13 +313,7 @@ app.on('window-all-closed', () => { | |||
305 | } | 313 | } |
306 | }); | 314 | }); |
307 | 315 | ||
308 | app.whenReady().then(async () => { | 316 | app.whenReady().then(createWindow).catch((err) => { |
309 | if (isDevelopment) { | ||
310 | await installDevToolsExtensions(); | ||
311 | } | ||
312 | |||
313 | return createWindow(); | ||
314 | }).catch((err) => { | ||
315 | console.error('Failed to create window', err); | 317 | console.error('Failed to create window', err); |
316 | process.exit(1); | 318 | process.exit(1); |
317 | }); | 319 | }); |