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
In preparation for unload being deprecated, Cypress is migrating to pagehide as a proxy for the unload event. With #29525, the window:unload event will be emitted when pagehide is triggered rather than when unload is triggered. As a next step in deprecating Cypress' window:unload, and to keep our API aligned with standards, we need to emit window:pagehide.
There are potential issues with how Cypress determines pageload with the load event. If a page is loaded from the back/forward cache, the load event may not fire (definitively for the top frame; unknown if this is applied to child frames). We should emit window:pageshow in addition to window:load, to provide the additional option to users and keep the load/unload path balanced.
What would you like?
Cypress should emit
window:pageshow
andwindow:pagehide
lifecycle events for the AUT.Why is this needed?
Chrome is progressively deprecating / preventing window 'unload' events and event listeners (see: https://developer.chrome.com/docs/web-platform/deprecating-unload ). `
In preparation for
unload
being deprecated, Cypress is migrating topagehide
as a proxy for theunload
event. With #29525, thewindow:unload
event will be emitted whenpagehide
is triggered rather than whenunload
is triggered. As a next step in deprecating Cypress'window:unload
, and to keep our API aligned with standards, we need to emitwindow:pagehide
.There are potential issues with how Cypress determines pageload with the
load
event. If a page is loaded from the back/forward cache, theload
event may not fire (definitively for the top frame; unknown if this is applied to child frames). We should emitwindow:pageshow
in addition towindow:load
, to provide the additional option to users and keep the load/unload path balanced.See flowchart: https://developer.chrome.com/docs/web-platform/page-lifecycle-api/image/page-lifecycle-api-state.svg
Other
No response
The text was updated successfully, but these errors were encountered: