It pretty much does the same, but does not trigger a pointless warning in PageSpeed insights.
See https://www.woltlab.com/community/thread/304788-page-speed-insights-optimierung-2024/
}
let ignoreConnectionErrors = false;
-window.addEventListener("unload", () => (ignoreConnectionErrors = true));
+window.addEventListener("beforeunload", () => (ignoreConnectionErrors = true));
class BackendRequest {
readonly #url: string;
});
// restore buttons, prevents disabled buttons on back navigation in Opera
- $(window).on('unload',function() {
- $forms.find('.formSubmit input[type=submit]').enable();
+ $(window).on("beforeunload", function () {
+ $forms.find(".formSubmit input[type=submit]").enable();
});
}
});
}
}
let ignoreConnectionErrors = false;
- window.addEventListener("unload", () => (ignoreConnectionErrors = true));
+ window.addEventListener("beforeunload", () => (ignoreConnectionErrors = true));
class BackendRequest {
#url;
#type;