mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-17 18:25:42 +02:00
[aidan] fix/browser: keep webview UA product token so Google sign-in works
This commit is contained in:
@@ -122,9 +122,9 @@ function markWindowsWebviewSurvived(): void {
|
||||
const isWindows = navigator.userAgent.includes('Windows');
|
||||
const isElectron = navigator.userAgent.includes('Electron') && (!isWindows || windowsWebviewEnabled());
|
||||
|
||||
// Keep the openswarm/<ver> product token: Google's sign-in flags a BARE Chrome UA as not-genuine-Chrome and blocks it ("browser may not be secure"), but tolerates a UA carrying a product token. Only the Electron token must go (that one Google hard-blocks).
|
||||
const chromeUserAgent = navigator.userAgent
|
||||
.replace(/\s*Electron\/\S+/i, '')
|
||||
.replace(/\s*openswarm\/\S+/i, '');
|
||||
.replace(/\s*Electron\/\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