Open
Description
Currently this article recommends using the unload
event to close popups and send stats. unload
cannot be relied upon and best practice is to avoid it entirely, using pagehide
or visibilitychange
.
E.g. popups should be closed in pagehide
, not unload
because a page that canenter BFCache will not fire unload
but will fire pagehide
Stats should not be sent from unload
because if the page goes into BFCache and the user never returns, the unload event will never fire.
Metadata
Metadata
Assignees
Labels
No labels