mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-12 04:37:44 +02:00
[eric] browser: strip openswarm/Electron from webview UA (case-insensitive; was leaking openswarm/1.5.1 to every site)
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user