Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 1.37 KB

_document-domain-workaround.mdx

File metadata and controls

24 lines (18 loc) · 1.37 KB

:::caution

Re-Enabling document.domain Injection

As of Cypress v14.0.0, document.domain will no longer be injected into text/html pages by default.

This means you must now use cy.origin() when navigating between different origins in the same test. Previously, cy.origin() was only necessary when navigating between different superdomains in the same test.

By setting the injectDocumentDomain configuration option to true, Cypress will attempt to inject document.domain into text/html pages.

A superdomain is comprised of the trailing two elements of the hostname, delimited by a . (period). Given https://www.cypress.io, the superdomain is determined to be cypress.io. When this option is enabled, cy.origin() is not necessary when navigating between https://www.cypress.io and https://docs.cypress.io, but is necessary when navigating between https://www.cypress.io and https://www.auth0.com.

  • This will cause issues with certain sites, especially those that use origin-keyed agent clusters.
  • This option is deprecated, and will be removed in a future version of Cypress. :::