Closed chris-steele closed 11 months ago
I don't think we should replace unload. More add pagehide.
Existing issue: https://github.com/adaptlearning/adapt_framework/issues/3481
beforeunload is an entirely different use-case and will not be deprecated as far as I understand.
Closing as duplicate of https://github.com/adaptlearning/adapt_framework/issues/3481
Subject of the issue
Chrome will soon soft deprecate the
unload
event. The functionality will be inoperable on all sites by Q1 2025 unless an opt-in is utilised. Note that the opt-in is expected to be a temporary measure and hard deprecation will follow which will see the event become completely inoperable.Propose we switch
unload
topagehide
to detect when a user is leaving a course. Note that likebeforeunload
/unload
this event is also unreliable, but we mitigate this by persisting data onvisibilitychange
(hidden) by default.Your environment
Relevant to all browsers and devices