You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cypress uses the unload event during AUT navigation, and emits a window:unload event that can be hooked into from tests. With unload forcibly deprecated, Cypress no longer works as expected, and the window:unload event will not fire.
Other
Background
To prevent Cypress runs from failing while we work to remove or find alternatives to using unload, we can leverage a permissions policy option added to Chrome 117 to preserve usage. This is not a permanent fix, and this permissions policy option will be removed in a future version of Chrome. This just gives us breathing room.
Potential complication: Documentation only provides a solution for single-layer cross-domain iframes. We will probably be able to make this work when the AUT is a cross-domain iframe with the App, but it is unlikely that we will be able to force unload events to be enabled when the AUT iframe includes a sub-iframe that is cross-domain with the AUT iframe.
Acceptance Criteria
Top level Cypress URL returns with a Permissions-Policy: unload=(self,"${AUT_URL}") header, where AUT_URL is the url that will be loaded in the AUT iframe
The AUT iframe has an allow="unload" property
Cypress' proxy sets Permissions-Policy: unload=self on AUT responses
Cypress' proxy modifies iframes in the AUT to include the allow="unload" property
The text was updated successfully, but these errors were encountered:
What would you like?
Chrome is deprecating the unload event. (see also: #29241)
Why is this needed?
Cypress uses the
unload
event during AUT navigation, and emits awindow:unload
event that can be hooked into from tests. Withunload
forcibly deprecated, Cypress no longer works as expected, and thewindow:unload
event will not fire.Other
Background
To prevent Cypress runs from failing while we work to remove or find alternatives to using
unload
, we can leverage a permissions policy option added to Chrome 117 to preserve usage. This is not a permanent fix, and this permissions policy option will be removed in a future version of Chrome. This just gives us breathing room.Potential complication: Documentation only provides a solution for single-layer cross-domain iframes. We will probably be able to make this work when the AUT is a cross-domain iframe with the App, but it is unlikely that we will be able to force unload events to be enabled when the AUT iframe includes a sub-iframe that is cross-domain with the AUT iframe.
Acceptance Criteria
Permissions-Policy: unload=(self,"${AUT_URL}")
header, whereAUT_URL
is the url that will be loaded in the AUTiframe
iframe
has anallow="unload"
propertyPermissions-Policy: unload=self
on AUT responsesiframe
s in the AUT to include theallow="unload"
propertyThe text was updated successfully, but these errors were encountered: