adaptlearning / adapt-contrib-spoor

A basic scorm tracking plugin for Adapt
GNU General Public License v3.0
14 stars 42 forks source link

Migrate from beforeunload/unload events #296

Closed chris-steele closed 11 months ago

chris-steele commented 11 months ago

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 to pagehide to detect when a user is leaving a course. Note that like beforeunload/unload this event is also unreliable, but we mitigate this by persisting data on visibilitychange (hidden) by default.

Your environment

Relevant to all browsers and devices

oliverfoster commented 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.

joe-allen-89 commented 11 months ago

Closing as duplicate of https://github.com/adaptlearning/adapt_framework/issues/3481