aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/devTools.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-02 11:32:59 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-02 11:46:08 +0100
commit3127fc53390bce67f816e4cc9112135785b067d5 (patch)
treecc9508224119a4c231acede12c72a502e1082537 /packages/main/src/devTools.ts
parentfix: Ensure dev user directory exists (diff)
downloadsophie-3127fc53390bce67f816e4cc9112135785b067d5.tar.gz
sophie-3127fc53390bce67f816e4cc9112135785b067d5.tar.zst
sophie-3127fc53390bce67f816e4cc9112135785b067d5.zip
fix: Allow devtools extensions to be installed
On the first startup in dev mode, Electron must be able to download the devtools extensions and wait for them to be installed. Loosens the UI process request filter a bit, but the behavior should match production mode in all cases except chrome webstore URLs. Nevertheless, only production mode should be considered secure. Fixes #6 Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/main/src/devTools.ts')
-rw-r--r--packages/main/src/devTools.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/main/src/devTools.ts b/packages/main/src/devTools.ts
index 7c7c86a..398904c 100644
--- a/packages/main/src/devTools.ts
+++ b/packages/main/src/devTools.ts
@@ -21,6 +21,20 @@
21import type { BrowserWindow } from 'electron'; 21import type { BrowserWindow } from 'electron';
22 22
23/** 23/**
24 * URL prefixes Sophie is allowed load in dev mode.
25 *
26 * In dev mode, in addition to the application itself,
27 * Sophie must be able do download and load the devtools and related extensions,
28 * so we have to make exceptions in the UI process request filter.
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
37/**
24 * Installs the react and redux developer tools extensions. 38 * Installs the react and redux developer tools extensions.
25 * 39 *
26 * We use the redux devtools and connect the mobx store to it with `mst-middlewares`, 40 * We use the redux devtools and connect the mobx store to it with `mst-middlewares`,