Repository navigation
Conversation
web.whatsapp.com UA-sniffs and shows its 'update Chrome' wall whenever the Electron/app product tokens are present, even alongside a current Chrome token (reproduced on 1.4.198: Chromium 150 rejected). Host-scoped exception mirroring the Google auth-host Firefox switch: only web.whatsapp.com sees the session identity minus the Orca/ and Electron/ tokens, kept consistent across the wire header (webRequest), the navigation override, and the viewport UA builder. The session-wide UA keeps the Electron tokens on purpose — a Chrome-shaped app-wide identity is what Cloudflare Turnstile rejects (see browser-session-ua.ts).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughAdds exact-host WhatsApp Web detection and user-agent compatibility helpers. WhatsApp Web navigation, request headers, and desktop viewport overrides now remove Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to WhatsApp Web receives a Chrome-compatible user agent without Orca or Electron tokens, while other hosts retain the existing identity. The change is ready to merge with no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, solution, scope, and verification limits, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing checklist, AI Disclosure, Review, boundary confirmation, Notes, and Checklist. Resolution Update the description to use the repository template. Add the missing sections, provide an issue reference after “Fixes #”, add
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor coverage gap noted below.
Reviewed changes
A host-scoped UA exception for web.whatsapp.com that strips the Orca/… and Electron/… product tokens from the session identity, applied in the three places a UA is decided — mirroring the existing Google auth-host Firefox switch while keeping the session-wide Electron tokens that Cloudflare Turnstile expects.
browser-whatsapp-ua.ts(new) —isWhatsAppWebUrl(exact-hostname match, rejects lookalikes) andwhatsAppCompatUserAgent(strips only the app and Electron tokens, case-insensitive and idempotent).browser-session-ua.ts— wire header rewrite for requests toweb.whatsapp.com.browser-manager-navigation.ts— navigation-timenavigator.userAgentoverride to the stripped UA, with restore on leaving the host.browser-viewport-user-agent.ts— desktop viewport UA builder strips the tokens on WhatsApp Web.- tests — new
browser-whatsapp-ua.test.ts(host matching, token stripping, lowercase dev token, idempotence) plus a WhatsApp case inbrowser-viewport-user-agent.test.ts.
I traced the override/restore transitions in applyGoogleAuthUserAgent, the wire handler, and the viewport builder (including the viewport-clear restore path in browser-manager-viewport.ts, which is already covered because it flows through buildViewportUserAgentOverride), and found no correctness issues. The hostname guard, token regex, and the whatsAppUa !== sessionUa && currentUa === whatsAppUa restore condition all check out.
ℹ️ Missing tests for the two host-switch integration points
The pure helpers and the viewport builder are well covered, but the two places where the WhatsApp exception plugs into existing host-switching machinery have no direct test, even though each Google equivalent does: the wire-handler branch in setupGoogleAuthUserAgentOverride (Google branches are tested in browser-session-registry.test.ts) and the navigation-time override/restore in applyGoogleAuthUserAgent (Google onto/off-host switching is tested in browser-manager-viewport-override.test.ts). The restore condition is subtle enough that pinning it is worth two extra cases.
Technical details
# Add integration tests for the WhatsApp UA exception
## Affected sites
- src/main/browser/browser-session-ua.ts:30 — WhatsApp wire-handler branch, untested (sibling Google branches each have a case in browser-session-registry.test.ts).
- src/main/browser/browser-manager-navigation.ts:53 — restore condition, untested (sibling Google onto/off-host switching is tested in browser-manager-viewport-override.test.ts).
## Required outcome
- One wire-handler test asserting the WhatsApp destination gets the stripped UA (and non-WhatsApp hosts still get the stock UA).
- One navigation test asserting the override is applied on entering web.whatsapp.com and restored to the session UA on leaving.
## Suggested approach (optional)
Mirror the existing `setupGoogleAuthUserAgentOverride` cases and the "onto and back off an auth host" navigation case, substituting the WhatsApp helpers.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Superseded by #19927 (merged as Your diagnosis here was correct and it was the first independent confirmation that the #19927 reverts the session-wide UA change from #18749, so Thanks for catching and reporting this one. |

Problem
Opening https://web.whatsapp.com in Orca's embedded browser shows WhatsApp's browser gate — "WhatsApp works with Google Chrome 100+ / To use WhatsApp, update Chrome" — even though the runtime is current.
Reproduced on Orca 1.4.198 (macOS): the embedded tabs send
WhatsApp's UA sniffing trips on the
Electron/…(and app) product tokens and refuses the session despiteChrome/150.Fix
Host-scoped UA exception for
web.whatsapp.comonly, mirroring the existing Google auth-host Firefox switch: that host sees the session identity minus theOrca/…andElectron/…tokens (platform, Chrome and WebKit/Safari tokens stay byte-identical to the real engine). Applied consistently in the three places a UA is decided:browser-session-ua.ts— the wire header viawebRequest.onBeforeSendHeadersbrowser-manager-navigation.ts— the navigation-timenavigator.userAgentoverride (with restore when leaving the host)browser-viewport-user-agent.ts— the desktop viewport UA builderThe session-wide UA deliberately keeps the Electron tokens: per the existing comment in
browser-session-ua.ts, a Chrome-shaped app-wide identity is exactly what Cloudflare Turnstile rejects (error 600010). Only the one host that gates on those tokens gets the stripped identity. Client hints are untouched — Chromium's realsec-ch-uabrands carry no Electron entry, so they agree with the stripped UA.Scope guard: exact-hostname match (
web.whatsapp.comonly —www/faq.whatsapp.comaccept the stock UA), lookalike hosts rejected.Verification
browser-whatsapp-ua.test.ts(host matching incl. lookalikes, token stripping incl. lowercase dev token, idempotence) and a WhatsApp case inbrowser-viewport-user-agent.test.ts.