Open cacieprins opened 6 months ago
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
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