Repository navigation
fix(driver): add --disable-web-security to the browser options - #342
Merged
Merged
Conversation
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.
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.
Companion to rubycdp/ferrum#649, which drops
--disable-web-securityfrom 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_urlwithin a frame from another origin raisesSecurityError: Blocked a frame ... from accessing a cross-origin frame, becauseFrame#current_urlreadswindow.top.location.hreffrom inside the frame. The click checks (mouseEventTest,isObscured) also usewindow.frameElement, which would benullin a cross-origin frame, so the frame offset would become 0.The driver now adds
"disable-web-security": niltobrowser_options, next toremote-allow-origins, so tests keep their current behavior. The flag is listed indocs/2-customization.mdamong 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.