Repository navigation
Conversation
…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).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_THIRDPARTYmatches the iOS third-party browser tokensCriOS/,EdgiOS/,FxiOS/,GSA/andDuckDuckGo/. The issue reports that DuckDuckGo for iOS now sends aDdg/brand token by default (example UA in the issue:... Safari/604.1 Ddg/18.7). With that UA,IS_IOS_THIRDPARTYis false,IS_AR_QUICKLOOK_CANDIDATEfalls back torelList.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 asIOS_THIRDPARTY_USER_AGENTso it can be tested, since the constants are evaluated once fromnavigator.userAgentat load time.Tests
New
src/test/constants-spec.tschecks that the pattern matchesDdg/,DuckDuckGo/,CriOS/,EdgiOS/,FxiOS/andGSA/UAs and does not match plain iOS Safari. Run locally with web-test-runner in Chrome: 4/4 pass; with theDdg/token removed theDdg/test fails.tscbuilds and clang-format is clean. Runningar-speclocally 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.