diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-01-13 02:34:40 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-02-08 21:43:03 +0100 |
commit | 5dbe6b2735c6e0f0d92f5f53806bcbcaeebfbdf2 (patch) | |
tree | 80c2e3a72a06489ab7b54682b1b8546d6bf06985 /packages/service-preload/src/index.ts | |
parent | feat: Service switcher buttons (diff) | |
download | sophie-5dbe6b2735c6e0f0d92f5f53806bcbcaeebfbdf2.tar.gz sophie-5dbe6b2735c6e0f0d92f5f53806bcbcaeebfbdf2.tar.zst sophie-5dbe6b2735c6e0f0d92f5f53806bcbcaeebfbdf2.zip |
fix: Do not access localStorage in service-preload
loglevel wants to persist the current log level in localStorage, which
apparently crashes the network service. We'll need to find another way
to log in service preload scripts. The main window preload scripts seems
unaffected, even though we use loglevel (and hence localStorage) in both
the preload and the renderer script.
Maybe related: https://github.com/electron/electron/issues/31689
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/service-preload/src/index.ts')
-rw-r--r-- | packages/service-preload/src/index.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/packages/service-preload/src/index.ts b/packages/service-preload/src/index.ts index bb4a62d..8b6630a 100644 --- a/packages/service-preload/src/index.ts +++ b/packages/service-preload/src/index.ts | |||
@@ -21,10 +21,6 @@ | |||
21 | import { ServiceToMainIpcMessage, webSource } from '@sophie/service-shared'; | 21 | import { ServiceToMainIpcMessage, webSource } from '@sophie/service-shared'; |
22 | import { ipcRenderer, webFrame } from 'electron'; | 22 | import { ipcRenderer, webFrame } from 'electron'; |
23 | 23 | ||
24 | import { getLogger } from './utils/log'; | ||
25 | |||
26 | const log = getLogger('index'); | ||
27 | |||
28 | if (webFrame.parent === null) { | 24 | if (webFrame.parent === null) { |
29 | // Inject CSS to simulate `browserView.setBackgroundColor`. | 25 | // Inject CSS to simulate `browserView.setBackgroundColor`. |
30 | // This is injected before the page loads, so the styles from the website will overwrite it. | 26 | // This is injected before the page loads, so the styles from the website will overwrite it. |
@@ -62,5 +58,5 @@ async function fetchAndExecuteInjectScript(): Promise<void> { | |||
62 | } | 58 | } |
63 | 59 | ||
64 | fetchAndExecuteInjectScript().catch((error) => { | 60 | fetchAndExecuteInjectScript().catch((error) => { |
65 | log.error('Failed to fetch inject source:', error); | 61 | console.error('Failed to fetch inject source:', error); |
66 | }); | 62 | }); |