From e7800a8a94a7d269d4ccb620011ac2084d58b4f0 Mon Sep 17 00:00:00 2001 From: abccodes Date: Sat, 27 Jun 2026 03:19:52 -0700 Subject: [PATCH] [aidan] fix/browser: keep webview UA product token so Google sign-in works --- frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx b/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx index 95430879..ae40d12e 100644 --- a/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx +++ b/frontend/src/app/pages/Dashboard/cards/BrowserCard.tsx @@ -122,9 +122,9 @@ function markWindowsWebviewSurvived(): void { const isWindows = navigator.userAgent.includes('Windows'); const isElectron = navigator.userAgent.includes('Electron') && (!isWindows || windowsWebviewEnabled()); +// Keep the openswarm/ 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';