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

Handle future Chrome version making document.domain immutable #20147

Closed
chrisbreiding opened this issue Feb 10, 2022 · 2 comments · Fixed by #20405
Closed

Handle future Chrome version making document.domain immutable #20147

chrisbreiding opened this issue Feb 10, 2022 · 2 comments · Fixed by #20405

Comments

@chrisbreiding
Copy link
Contributor

What would you like?

Chrome is planning to make document.domain immutable.

In Chrome 100, setting document.domain will display the following warning in the Issues panel.

emNay9XjqqyNy3wEi0Aa

In Chrome 106 (due for release in April 2022), support for setting document.domain will be removed. It will log the following warning in the console and setting it will silently fail, causing a cross-origin error to be thrown when Cypress attempts to interact with the AUT. The exact release is subject to change based on the response to the Intent to Ship.

Screen Shot 2022-02-10 at 12 56 13 PM

Mitigation

This issue can be mitigated by attaching a Origin-Agent-Cluster: ?0 header to the top page's request, any requests for the AUT frame's src, and any requests for the spec frame and support file frame. That will allow document.domain to be set as needed.

More Information

Why is this needed?

Cypress relies on setting document.domain so that a test can visit multiple subdomains under the same super-domain in a single test.

Once support for setting document.domain is removed, tests that rely on that behavior will no longer function and will fail with a cross-origin error.

Other

No response

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 4, 2022

The code for this is done in cypress-io/cypress#20405, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Mar 4, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 14, 2022

Released in 9.5.2.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.5.2, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants