Skip to content

fix(constants): recognize DuckDuckGo iOS "Ddg/" user for AR Quick Look - #5229

Open
13Sharad wants to merge 2 commits into
google:masterfrom
13Sharad:fix-ddg-ios-user-agent
Open

13Sharad wants to merge 2 commits into
google:masterfrom
13Sharad:fix-ddg-ios-user-agent

Conversation

@13Sharad

Copy link
Copy Markdown

Reference Issue

Refs #5227. This covers only the DuckDuckGo iOS part of that issue (the Ecosia iOS and Firefox for Android parts are not touched).

Problem

IS_IOS_THIRDPARTY matches the iOS third-party browser tokens CriOS/, EdgiOS/, FxiOS/, GSA/ and DuckDuckGo/. The issue reports that DuckDuckGo for iOS now sends a Ddg/ brand token by default (example UA in the issue: ... Safari/604.1 Ddg/18.7). With that UA, IS_IOS_THIRDPARTY is false, IS_AR_QUICKLOOK_CANDIDATE falls back to relList.supports('ar'), and the AR button is not offered. The UA string and the browser behavior come from the issue reporter; I have not tested on a DuckDuckGo iOS device.

Fix

Add Ddg/ to the pattern. The pattern is now exported as IOS_THIRDPARTY_USER_AGENT so it can be tested, since the constants are evaluated once from navigator.userAgent at load time.

Tests

New src/test/constants-spec.ts checks that the pattern matches Ddg/, DuckDuckGo/, CriOS/, EdgiOS/, FxiOS/ and GSA/ UAs and does not match plain iOS Safari. Run locally with web-test-runner in Chrome: 4/4 pass; with the Ddg/ token removed the Ddg/ test fails. tsc builds and clang-format is clean. Running ar-spec locally shows one failing test (openSceneViewer > gracefully degrades to base model URI for multi-model scenes instead of crashing via blob:, a 2s timeout) that fails the same way on unmodified master, so it is unrelated to this change.

…ck Look

DuckDuckGo for iOS now sends a "Ddg/" brand token by default instead of "DuckDuckGo/". IS_IOS_THIRDPARTY only matched the old token, so IS_AR_QUICKLOOK_CANDIDATE fell back to relList.supports('ar'), which is false in that WKWebView, and the AR button was not offered.

Match "Ddg/" as well and expose the pattern as IOS_THIRDPARTY_USER_AGENT so it can be tested.

Refs google#5227 (covers only the DuckDuckGo iOS part).
@13Sharad 13Sharad changed the title fix(constants): recognize DuckDuckGo iOS "Ddg/" user agent for AR Quick Look fix(constants): recognize DuckDuckGo iOS "Ddg/" user for AR Quick Look Nov 25, 2026

This branch has not been deployed

No deployments
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.

1 participant