Skip to content

Commit

Permalink
Revert "Sends beacon request in beforeunload event in Firefox (#20198)…
Browse files Browse the repository at this point in the history
…" (#20225) (#20227)

This reverts commit e554b45.

Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com>
  • Loading branch information
vaadin-bot and tepi authored Oct 11, 2024
1 parent 0d28da4 commit 07aaa4d
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,9 @@ public void start(ValueMap initialUidl) {
registry.getMessageHandler().handleMessage(initialUidl);
}

if (BrowserInfo.get().isFirefox()) {
// Sends in beforeunload in FF (don't support beacon in pagehide)
Browser.getWindow().addEventListener("beforeunload", e -> {
registry.getMessageSender().sendUnloadBeacon();
});
} else {
Browser.getWindow().addEventListener("pagehide", e -> {
registry.getMessageSender().sendUnloadBeacon();
});
}
Browser.getWindow().addEventListener("pagehide", e -> {
registry.getMessageSender().sendUnloadBeacon();
});

Browser.getWindow().addEventListener("pageshow", e -> {
// Currently only Safari gets here, sometimes when going back/foward
Expand Down

0 comments on commit 07aaa4d

Please sign in to comment.