[eric] browser: strip openswarm/Electron from webview UA (case-insensitive; was leaking openswarm/1.5.1 to every site)

This commit is contained in:
ciregenz
2026-06-25 23:40:32 -07:00
parent 8cb781c01c
commit 215ddb45c0
@@ -121,8 +121,8 @@ const isWindows = navigator.userAgent.includes('Windows');
const isElectron = navigator.userAgent.includes('Electron') && (!isWindows || windowsWebviewEnabled());
const chromeUserAgent = navigator.userAgent
.replace(/\s*Electron\/\S+/, '')
.replace(/\s*OpenSwarm\/\S+/, '');
.replace(/\s*Electron\/\S+/i, '')
.replace(/\s*openswarm\/\S+/i, '');
// Persistent partition so browser-card logins/cookies/localStorage outlive a reload or quit. MUST match BROWSER_PARTITION in electron/main.js, which configures permissions + iframe header-strip on this exact partition.
const BROWSER_PARTITION = 'persist:openswarm-browser';