Add means to detect if a script is loading, has loaded, or has errored #4594
Labels
addition/proposal
New features or enhancements
needs concrete proposal
Moving the issue forward requires someone to figure out a detailed plan
needs implementer interest
Moving the issue forward requires implementers to express interest
topic: script
Something like a
[SameValue] attribute Promise<void> loaded;
onHTMLScriptElement
would be nice, where it's resolved immediately with the load event itself when the script completes execution and rejected immediately with the error event itself if/when an error occurs.Currently, there is no way to tell if a script is loaded or not, and that would be very useful in a lot of contexts, particularly when the script is in the HTML itself and might not yet be loaded.
This is possible to polyfill, but only for scripts you can control the loading of. Conceptually, it's as simple as this:
The text was updated successfully, but these errors were encountered: