- From: Andrea Giammarchi <notifications@github.com>
- Date: Tue, 08 Oct 2024 03:05:58 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 8 October 2024 10:06:02 UTC
in all fairness, while I fully agree this should be solved, I wish there was a better primitive to know which script is currently executing. In modules, that could be locally scoped per module, in synchronous scripts that's exactly what (not hijacked) `document.currentScript` is, in async cases that should be somehow also possible to retrieve as locally scoped or somehow once ... `document.currentScript` as it is now also misleads async code, listeners, and so on and the way we are ensuring it's the expected one for our custom script tags is to temporarily override the reference and remove it on top level script async scope executed which works but it's utterly ugly and potentially error prone for other sync scripts maybe injected during the exact same time. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/1315#issuecomment-2399420903 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/1315/2399420903@github.com>
Received on Tuesday, 8 October 2024 10:06:02 UTC