-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds concrete proposalMoving the issue forward requires someone to figure out a detailed planMoving the issue forward requires someone to figure out a detailed planneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interesttopic: script
Description
Something like a [SameValue] attribute Promise<void> loaded;
on HTMLScriptElement
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:
script.loaded = new Promise((resolve, reject) => {
script.addEventListener("load", resolve, false)
script.addEventListener("error", reject, false)
})
Metadata
Metadata
Assignees
Labels
addition/proposalNew features or enhancementsNew features or enhancementsneeds concrete proposalMoving the issue forward requires someone to figure out a detailed planMoving the issue forward requires someone to figure out a detailed planneeds implementer interestMoving the issue forward requires implementers to express interestMoving the issue forward requires implementers to express interesttopic: script