inline-scripts icon indicating copy to clipboard operation
inline-scripts copied to clipboard

Deferred scripts are not handled correctly

Open ading2210 opened this issue 1 year ago • 0 comments

Script tags such as <script src="main.js" defer></script> will not work correctly, since when they are inlined they are executed immediately in the document's head. This breaks existing code because deferred scripts assume the entire DOM has already loaded. I suspect scripts with the async tag would also break in a similar way, but I have not verified this.

A possible fix would be moving deferred script tags to the end of the page.

ading2210 avatar Aug 21 '24 20:08 ading2210