Skip to content

feat(webview): add a user agent suffix - #1013

Merged
houko merged 5 commits into
nsgo-dev:mainfrom
houko:assess/issue114-webview-controls-impl
Nov 20, 2026
Merged

houko merged 5 commits into
nsgo-dev:mainfrom
houko:assess/issue114-webview-controls-impl

Conversation

@houko

@houko houko commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of #114 (muting is not in this PR; ClearWebsiteData already landed).

Verification

  • go tool nsgo test ./core
  • go tool nsgo check -target macos,linux,windows,android -jobs 2

@houko
houko force-pushed the assess/issue114-webview-controls-impl branch from 3952e22 to 0382405 Compare November 20, 2026 15:18
@github-actions github-actions Bot added size/M documentation Improvements or additions to documentation tsx conflict Conflicts with the base branch; resolve it first and removed size/S labels Nov 20, 2026
@houko
houko force-pushed the assess/issue114-webview-controls-impl branch from 0382405 to 2b432cf Compare November 20, 2026 16:50
@houko houko changed the title feat(webview): add user agent suffix and audio controls feat(webview): add a user agent suffix Nov 20, 2026
@github-actions github-actions Bot removed the conflict Conflicts with the base branch; resolve it first label Nov 20, 2026
@houko

houko commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed. Rebased onto main (CHANGELOG conflict only, both bullets kept). The suffix is wired on every target that honors UserAgent (Apple via applicationNameForUserAgent at creation plus setCustomUserAgent:, Android WebSettings, Windows settings and the Mobile CDP override, WebKitGTK settings); HarmonyOS, the web and mini programs keep their own user agent as documented.

Changes:

  • Retitled the PR and changed Closes #114 to Part of #114: muting is not implemented here and stays tracked in the roadmap, so [Feature] Web view: mute a page's audio, clear the stored website data, and append to the platform's user agent #114 should stay open.
  • Added a TSX test that userAgentSuffix reaches the config and that a change makes a new web view (which is why Apple's create-time limitation does not affect TSX), and mentioned userAgentSuffix in the TSX remount sentence of the en/zh component docs.
  • Added a Windows native test (internal/platform/windows/webuseragent_test.go) matching the Linux and macOS ones, and a websource nsgotest that checks navigator.userAgent ends in the suffix on every native target CI runs it on.

Verified on devices:

  • Windows VM (WebView2 157): the new native test passes; request headers and navigator.userAgent are the Edge default + suffix, nsgo-test + suffix, and the Android mobile UA + suffix. TestWebMobilePresentsAPhone still passes.
  • Linux desktop VM (WebKitGTK): the PR's native test passes with the same three cases.
  • Pixel 3 XL: the new websource test passes on the device.
  • macOS/iOS: not checked on a device (screen locked); covered by CI's macOS native test and websource run.

CI: all 20 checks green on 49dedca.

@houko
houko merged commit 8b464cf into nsgo-dev:main Nov 20, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android core documentation Improvements or additions to documentation enhancement New feature or request iOS Linux macOS size/M tsx Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant