Skip to content

Improve desktop site user agent handling#82

Merged
kododake merged 1 commit into
kododake:mainfrom
gregorixG:fix-desktop-mode-client-hints
Jun 13, 2026
Merged

Improve desktop site user agent handling#82
kododake merged 1 commit into
kododake:mainfrom
gregorixG:fix-desktop-mode-client-hints

Conversation

@gregorixG

Copy link
Copy Markdown
Contributor

Summary

Improves Request desktop site handling in the WebView browser.

Previously, desktop mode changed the legacy User-Agent string and viewport settings, but some modern sites still detected the browser as mobile through Chromium User-Agent Client Hints. This could make desktop mode work on sites like Google and YouTube, while still failing on stricter sites.

What Changed

  • Replaced the separate desktop UA setup with a unified browser identity update.
  • Added AndroidX WebKit UserAgentMetadata support for Chromium client hints.
  • Desktop Chrome mode now reports desktop-style metadata:
    • sec-ch-ua-platform: "Windows"
    • sec-ch-ua-mobile: ?0
    • desktop architecture and bitness metadata
  • Mobile mode keeps the previous Android-style behavior.
  • Desktop mode now applies a 100% initial scale, while mobile mode keeps the existing density-based scale.

Why

Some sites no longer rely only on navigator.userAgent. They also inspect User-Agent Client Hints like sec-ch-ua-mobile and sec-ch-ua-platform.

Without matching those hints, WebView can send a desktop UA string while still exposing mobile-like metadata, causing certain sites to keep serving the mobile layout.

@kododake kododake merged commit 517a77f into kododake:main Jun 13, 2026
@kododake

Copy link
Copy Markdown
Owner

Sorry for the late review! 🙏 Thank you for the wonderful pull request! ✨

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.

2 participants