Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocked a frame with origin: XXX from accessing cross origin frame #2784

Closed
brian-mann opened this issue Nov 15, 2018 · 6 comments · Fixed by #2787
Closed

Blocked a frame with origin: XXX from accessing cross origin frame #2784

brian-mann opened this issue Nov 15, 2018 · 6 comments · Fixed by #2787
Assignees
Milestone

Comments

@brian-mann
Copy link
Member

brian-mann commented Nov 15, 2018

This is happening when the current subject is <window>, there is a cross origin iframe within the application under test, and there is an assertion off of a parent command like:

cy.get('a').should('be.visible')

Why? Because apparently accessing window[0] now returns the cross origin window. I can't find where in the spec it defines this behavior, and perhaps this is a recent change to chrome?

At any rate, this is happening because we have some naive internal checks to determine whether a value is an element, the document, or the window.

screen shot 2018-11-14 at 7 38 28 pm

@brian-mann brian-mann self-assigned this Nov 15, 2018
@brian-mann brian-mann added this to the Sprint 11 milestone Nov 15, 2018
@bahmutov
Copy link
Contributor

bahmutov commented Nov 15, 2018 via email

brian-mann added a commit that referenced this issue Nov 15, 2018
…ring value and subject

-this prevents a situation where we accidentally iterate through a
cross origin <window> object and cause cross origin issues
@brian-mann
Copy link
Member Author

@bahmutov that's true, didn't think to test in electron, smh - oh well its fixed now

@bahmutov
Copy link
Contributor

bahmutov commented Nov 15, 2018 via email

@bahmutov
Copy link
Contributor

bahmutov commented Nov 15, 2018 via email

brian-mann added a commit that referenced this issue Nov 16, 2018
* synchronize lodash versions

* start driver test server on 3500 + 3501 the same way

* fixes #2784, short circuit checks to discover the DOM type when comparing value and subject

-this prevents a situation where we accidentally iterate through a
cross origin <window> object and cause cross origin issues

* fix functions not being invoked with value

* skip bad jira test derp
@brian-mann
Copy link
Member Author

brian-mann commented Nov 19, 2018

Released in 3.1.2.

@zinglax
Copy link

zinglax commented Nov 7, 2020

Switched from chrome to electron and my error went away. Glad there was a solution to this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants