I'm using the following code to display a "loading" overlay when navigating our web application. This works just fine in Chrome, Firefox und IE / Edge... but not in Safari. The event is triggered and the console log shows the event – but the visual change via jQuery show() has no effect.
$(document).ready(function() {
$(window).on("beforeunload", function() {
console.log("in beforeunload...");
$("#overlay").show();
});
});
Is this a known limitation in Safari (macOS) or am I missing something? Is there some workaround?