I'm trying to create a custom "loading" animation that should start when the next page has started loading. In practice, I'd like to receive an event when the browser is starting to load the next toplevel frame regardless if the source of the load event is button click, link activation or JavaScript setting window.location.href
. In addition, I'd like to receive the event when the loading is started, not when the next page is ready to be swapped over the current page.
I'd expect the code to be something along the lines
window.document.addEventListener("???????", function (e) { ... });
can anybody point me to the correct event name?