Skip to content

Commit

Permalink
fix: Adding a pagehide listener to cover bases when unload becomes de…
Browse files Browse the repository at this point in the history
…precated (#125)
  • Loading branch information
cahirodoherty-learningpool authored Nov 15, 2023
1 parent 8b375de commit 7ed0088
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/XAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class XAPI extends Backbone.Model {
if (['ios', 'android'].indexOf(Adapt.device.OS) > -1) {
$(document).on('visibilitychange', this.onVisibilityChange.bind(this));
} else {
$(window).on('beforeunload unload', this.sendUnloadStatements.bind(this));
$(window).on('beforeunload unload pagehide', this.sendUnloadStatements.bind(this));
}

if (!this.get('shouldTrackState')) {
Expand Down

0 comments on commit 7ed0088

Please sign in to comment.