Is there a DOM event that fires when (in addition to all of the DOM elements being loaded including images, stylesheets etc.) some initial Javascript finishes fetching data and then updates DOM?
The use case is in a closed system where I am calling window.print()
to open a print dialog, but only once full page is loaded and all Javascript returns its data.
I have tried using MutationObserver
, but it fires multiple times and I need it to fire only once when all of the loading is finished.
I have a workaround ready (by creating a Custom Event and firing it when scripts finish), but I am wondering if there is some kind of built-in event that is capable of this.