Skip to content

fix(driver): add --disable-web-security to the browser options - #342

Merged
route merged 1 commit into
mainfrom
fix/disable-web-security
Oct 16, 2026
Merged

route merged 1 commit into
mainfrom
fix/disable-web-security

Conversation

@route

@route route commented Oct 16, 2026

Copy link
Copy Markdown
Member

Companion to rubycdp/ferrum#649, which drops --disable-web-security from Ferrum's default Chrome flags (rubycdp/ferrum#472). Release both together.

Capybara suites rely on the flag to reach into cross-origin frames. Without it, current_url within a frame from another origin raises SecurityError: Blocked a frame ... from accessing a cross-origin frame, because Frame#current_url reads window.top.location.href from inside the frame. The click checks (mouseEventTest, isObscured) also use window.frameElement, which would be null in a cross-origin frame, so the frame offset would become 0.

The driver now adds "disable-web-security": nil to browser_options, next to remote-allow-origins, so tests keep their current behavior. The flag is listed in docs/2-customization.md among the Ferrum defaults Cuprite changes.

Full suite against the ferrum branch: 1855 examples, 0 failures. CI here still runs against released Ferrum 0.19.0, which passes the flag itself, so it won't show the difference until Ferrum is released.

Ferrum no longer passes the flag by default (rubycdp/ferrum#472), but tests rely on reaching into cross-origin frames,
e.g. current_url within a frame from another origin, so Cuprite sets it itself.
@route
route merged commit d3040c0 into main Oct 16, 2026
7 checks passed
@route
route deleted the fix/disable-web-security branch October 16, 2026 13:28
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