diff options
author | 2021-12-24 03:07:06 +0100 | |
---|---|---|
committer | 2021-12-24 03:09:02 +0100 | |
commit | 5c301457e6a03823b069eec0235ee569342a7e49 (patch) | |
tree | c841d1da6fdeee08324d5903327f1caf754979e2 /packages/main/src/index.ts | |
parent | refactor: Load ui and service in parallel (diff) | |
download | sophie-5c301457e6a03823b069eec0235ee569342a7e49.tar.gz sophie-5c301457e6a03823b069eec0235ee569342a7e49.tar.zst sophie-5c301457e6a03823b069eec0235ee569342a7e49.zip |
feat: User-agent reduction
Unfortunately, the reduced user-agent doesn't fool the google login
form, but at least reduces the amount of leaked information.
Diffstat (limited to 'packages/main/src/index.ts')
-rw-r--r-- | packages/main/src/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index 4308d55..b6df67b 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts | |||
@@ -39,6 +39,7 @@ import { | |||
39 | openDevToolsWhenReady, | 39 | openDevToolsWhenReady, |
40 | } from './devTools'; | 40 | } from './devTools'; |
41 | import { createRootStore } from './stores/RootStore'; | 41 | import { createRootStore } from './stores/RootStore'; |
42 | import { reduceUserAgent } from './userAgent'; | ||
42 | 43 | ||
43 | const isDevelopment = import.meta.env.MODE === 'development'; | 44 | const isDevelopment = import.meta.env.MODE === 'development'; |
44 | 45 | ||
@@ -66,7 +67,7 @@ app.commandLine.appendSwitch( | |||
66 | 67 | ||
67 | // Remove sophie and electron from the user-agent string to avoid detection. | 68 | // Remove sophie and electron from the user-agent string to avoid detection. |
68 | const originalUserAgent = app.userAgentFallback; | 69 | const originalUserAgent = app.userAgentFallback; |
69 | const userAgent = originalUserAgent.replaceAll(/ ([Ss]ophie|Electron)\/[0-9.]+/g, ''); | 70 | const userAgent = reduceUserAgent(originalUserAgent); |
70 | // Removing the electron version breaks redux devtools, so we only do this in production. | 71 | // Removing the electron version breaks redux devtools, so we only do this in production. |
71 | if (!isDevelopment) { | 72 | if (!isDevelopment) { |
72 | app.userAgentFallback = userAgent; | 73 | app.userAgentFallback = userAgent; |