Skip to content

feat(html): make the navigator profile configurable - #279

Open
Sonic-Y3k wants to merge 1 commit into
gost-dom:mainfrom
Sonic-Y3k:feat/navigator-options
Open

feat(html): make the navigator profile configurable#279
Sonic-Y3k wants to merge 1 commit into
gost-dom:mainfrom
Sonic-Y3k:feat/navigator-options

Conversation

@Sonic-Y3k

@Sonic-Y3k Sonic-Y3k commented Jun 27, 2026

Copy link
Copy Markdown

Configurable navigator profile

Split out of #274, taking the approach suggested there: rather than hardcoding a
single browser identity in core, the values reported by navigator are
configurable per browser.

  • html.NavigatorProfile holds the configurable fields (user agent, platform,
    vendor, language(s), hardware concurrency).
  • browser.WithNavigator(profile) sets it; unset fields fall back to
    html.DefaultNavigatorProfile, which describes a current Chrome release so apps
    under test see a realistic, modern browser.
  • The navigator data attributes read their values from the per-window
    html.Navigator instance, so each browser reports its own profile.

Tested in the shared script-engine suite (both V8 and Sobek), covering the
default profile and an override.


AI disclosure: This change was developed with the help of an AI coding assistant. I've reviewed and tested it myself; it follows the existing conventions and the full test suite (main module, v8engine, sobekengine) passes locally.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Sonic-Y3k, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 56 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2ad932f0-a462-47f0-b169-08738506c929

📥 Commits

Reviewing files that changed from the base of the PR and between 98adcf9 and e2e2a7e.

📒 Files selected for processing (7)
  • browser.go
  • html/navigator.go
  • html/window.go
  • scripting/internal/html/initializer.go
  • scripting/internal/html/navigator.go
  • scripting/internal/scripttests/navigator_suite.go
  • scripting/internal/scripttests/suites.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Add a NavigatorProfile (user agent, platform, vendor, language(s), hardware
concurrency) that client code supplies via the new browser.WithNavigator
option, rather than the core module hardcoding a single browser identity. Unset
fields fall back to DefaultNavigatorProfile, which describes a current Chrome
release so applications under test see a realistic, modern browser.

The navigator data attributes read their values from the per-window
html.Navigator instance, so each browser reports its own configured profile.
The test runs in the shared script-engine suite, covering both the V8 and Sobek
engines for the default profile and an override.
@Sonic-Y3k
Sonic-Y3k force-pushed the feat/navigator-options branch from 411e6d2 to e2e2a7e Compare June 27, 2026 12:03
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