aboutsummaryrefslogtreecommitdiffstats
path: root/packages/main/src/index.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-24 03:07:06 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-12-24 03:09:02 +0100
commit5c301457e6a03823b069eec0235ee569342a7e49 (patch)
treec841d1da6fdeee08324d5903327f1caf754979e2 /packages/main/src/index.ts
parentrefactor: Load ui and service in parallel (diff)
downloadsophie-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.ts3
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';
41import { createRootStore } from './stores/RootStore'; 41import { createRootStore } from './stores/RootStore';
42import { reduceUserAgent } from './userAgent';
42 43
43const isDevelopment = import.meta.env.MODE === 'development'; 44const 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.
68const originalUserAgent = app.userAgentFallback; 69const originalUserAgent = app.userAgentFallback;
69const userAgent = originalUserAgent.replaceAll(/ ([Ss]ophie|Electron)\/[0-9.]+/g, ''); 70const 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.
71if (!isDevelopment) { 72if (!isDevelopment) {
72 app.userAgentFallback = userAgent; 73 app.userAgentFallback = userAgent;