1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 18:26:38 -04:00

fix silly AMP and lighthouse warnings

https://developers.google.com/web/updates/2018/07/page-lifecycle-api#the-unload-event
This commit is contained in:
2020-11-19 10:56:25 -05:00
parent e6400400f1
commit c58dddbed2
6 changed files with 7 additions and 5 deletions

View File

@ -203,7 +203,10 @@
// }
};
addEventListenerFunc("unload", sendOnLeave, false);
// https://developers.google.com/web/updates/2018/07/page-lifecycle-api#the-unload-event
var terminationEvent = "onpagehide" in self ? "pagehide" : "unload";
addEventListenerFunc(terminationEvent, sendOnLeave, false);
// addEventListenerFunc("unload", sendOnLeave, false);
/** if scroll **/
var body = doc.body || {};