Add Android and iOS WebView detection with Client Hints support#614
Draft
Add Android and iOS WebView detection with Client Hints support#614
Conversation
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add WebView detection for Android and iOS
Add Android and iOS WebView detection
Mar 14, 2026
Collaborator
|
@copilot can we perhaps validate this using clients hints or an additional mechanism? |
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
Contributor
Author
Done in 37903d2. The Android WebView descriptor now checks Client Hints first:
iOS WebView stays UA-only since iOS doesn't implement the UA Client Hints API. |
Copilot
AI
changed the title
Add Android and iOS WebView detection
Add Android and iOS WebView detection with Client Hints support
Mar 14, 2026
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.
Bowser currently misidentifies Android WebView as Chrome and iOS WebView as Safari. This adds proper detection for both, with Client Hints validation for Android WebView.
Detection approach
Chrome WebView): checkshasBrand('Android WebView')from User-Agent Client Hints first (the brand Chromium-based WebViews expose innavigator.userAgentData.brands), then falls back to the UA-string; wv)canonical marker. Version is extracted from Client Hints when available, otherwise from the Chrome version in the UA string. Descriptor placed before Chrome to prevent false Chrome matches.iOS WebView): tests foriPhone|iPad|iPod+AppleWebKitwithout aSafari/suffix. Standard iOS Safari always includesSafari/XXX; UIWebView and WKWebView do not. iOS does not implement the UA Client Hints API, so UA-string detection is the only available mechanism. Descriptor placed before Safari. Extracts AppleWebKit version.Files changed
src/parser-browsers.js— two new descriptors:Chrome WebView(before Chrome, with Client Hints + UA fallback) andiOS WebView(before Safari, UA-only)src/constants.js—chrome_webview/ios_webviewadded to bothBROWSER_ALIASES_MAPandBROWSER_MAPtest/acceptance/useragentstrings.yml— 4 new acceptance test cases (Nexus 5 + Samsung Galaxy for Android; iPhone + iPad for iOS)test/unit/parser.js— 4 new unit tests covering Client Hints detection and UA fallback for Android WebViewUsage
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.