fix(tracker): force sending on body mouseleave (works on firefox unlike document's mouseleave)

This commit is contained in:
Alex Kaminskii 2022-06-27 20:34:32 +02:00
parent 2c88aece56
commit f78da27562

View file

@ -163,7 +163,7 @@ export default class App {
}
// TODO: keep better tactics, discard others (look https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon)
this.attachEventListener(window, 'beforeunload', alertWorker, false);
this.attachEventListener(document, 'mouseleave', alertWorker, false, false);
this.attachEventListener(document.body, 'mouseleave', alertWorker, false, false);
this.attachEventListener(document, 'visibilitychange', alertWorker, false);
} catch (e) {
this._debug("worker_start", e);