aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/infrastructure/electron/impl/devTools.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/main/src/infrastructure/electron/impl/devTools.ts')
-rw-r--r--packages/main/src/infrastructure/electron/impl/devTools.ts34
1 files changed, 7 insertions, 27 deletions
diff --git a/packages/main/src/infrastructure/electron/impl/devTools.ts b/packages/main/src/infrastructure/electron/impl/devTools.ts
index 10f4545..6b06d8f 100644
--- a/packages/main/src/infrastructure/electron/impl/devTools.ts
+++ b/packages/main/src/infrastructure/electron/impl/devTools.ts
@@ -20,32 +20,19 @@
20 20
21import type { BrowserWindow } from 'electron'; 21import type { BrowserWindow } from 'electron';
22 22
23/** 23/* eslint-disable
24 * URL prefixes Sophie is allowed load in dev mode. 24 import/no-extraneous-dependencies,
25 * 25 global-require,
26 * In dev mode, in addition to the application itself, 26 @typescript-eslint/no-var-requires,
27 * Sophie must be able do download and load the devtools and related extensions, 27 unicorn/prefer-module --
28 * so we have to make exceptions in the UI process request filter. 28 Hack to lazily require a CJS module from an ES module transpiled into a CJS module.
29 */ 29*/
30export const DEVMODE_ALLOWED_URL_PREFIXES = [
31 'chrome-extension:',
32 'devtools:',
33 'https://clients2.google.com/service/update2/crx',
34 'https://clients2.googleusercontent.com/crx',
35];
36 30
37/** 31/**
38 * Enables using source maps for node stack traces. 32 * Enables using source maps for node stack traces.
39 */ 33 */
40export function enableStacktraceSourceMaps(): void { 34export function enableStacktraceSourceMaps(): void {
41 const sourceMapSupport = 35 const sourceMapSupport =
42 /* eslint-disable-next-line
43 import/no-extraneous-dependencies,
44 global-require,
45 @typescript-eslint/no-var-requires,
46 unicorn/prefer-module --
47 Hack to lazily require a CJS module from an ES module transpiled into a CJS module.
48 */
49 require('source-map-support') as typeof import('source-map-support'); 36 require('source-map-support') as typeof import('source-map-support');
50 sourceMapSupport.install(); 37 sourceMapSupport.install();
51} 38}
@@ -61,13 +48,6 @@ export async function installDevToolsExtensions(): Promise<void> {
61 default: installExtension, 48 default: installExtension,
62 REACT_DEVELOPER_TOOLS, 49 REACT_DEVELOPER_TOOLS,
63 REDUX_DEVTOOLS, 50 REDUX_DEVTOOLS,
64 /* eslint-disable-next-line
65 import/no-extraneous-dependencies,
66 global-require,
67 @typescript-eslint/no-var-requires,
68 unicorn/prefer-module --
69 Hack to lazily require a CJS module from an ES module transpiled into a CJS module.
70 */
71 } = require('electron-devtools-installer') as typeof import('electron-devtools-installer'); 51 } = require('electron-devtools-installer') as typeof import('electron-devtools-installer');
72 await installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS], { 52 await installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS], {
73 forceDownload: false, 53 forceDownload: false,