Skip to content

CA-6409: Add an API to allow a site to change the user agent to Safari#266

Merged
davertay-j merged 3 commits into
mainfrom
tiffner/CA-6409-redux
Jun 15, 2026
Merged

CA-6409: Add an API to allow a site to change the user agent to Safari#266
davertay-j merged 3 commits into
mainfrom
tiffner/CA-6409-redux

Conversation

@Phoenix7351

@Phoenix7351 Phoenix7351 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Any page can change the reported user agent mid-session, which can alter server routing, feature flags, and compatibility behavior; the bridge is narrow but not origin-restricted in this diff.

Overview
Adds topaz.setUserAgentMode('topaz' | 'safari') so loaded pages can switch the WebView user agent at runtime, mainly to present a Safari-like UA when sites gate on it.

The flow is a new topaz WebKit JS message channel (topazRequest in TS and the injected polyfill) handled by TopazScriptHandler in Coordinator, which updates WebPageModel.userAgentMode and applies WKWebView.customUserAgent. WebPageModel now picks between fixed Topaz and Safari UA strings (default remains Topaz). Coordinator.update also reapplies the model’s UA when the web view updates.

The large BluetoothPolyfill.js diff is mostly a rebuild (e.g. topazRequest, class field style, docs); behavior changes there are incidental to shipping the new Topaz API in the bundle.

Reviewed by Cursor Bugbot for commit 4ca839f. Configure here.

@Phoenix7351 Phoenix7351 requested a review from sdonn3 June 12, 2026 18:34
@davertay-j davertay-j merged commit de62966 into main Jun 15, 2026
3 checks passed
@davertay-j davertay-j deleted the tiffner/CA-6409-redux branch June 15, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants