mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
According to MDN, inline script tags should not have defer/async attributes. But some do. This ignores those attributes for inline script tags. (Previously, we were only half ignoring them. We were treating them as inline, but flagging them as deferred or async, which was causing issues with cleanup) Fixes: https://github.com/lightpanda-io/browser/issues/1014
28 lines
694 B
HTML
28 lines
694 B
HTML
<head>
|
|
<script>
|
|
let dyn1_loaded = 0;
|
|
function loadScript(src) {
|
|
const script = document.createElement('script');
|
|
script.src = src;
|
|
document.getElementsByTagName("head")[0].appendChild(script)
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<script src="../../testing.js"></script>
|
|
|
|
<script defer>
|
|
loadScript('inline_defer.js');
|
|
</script>
|
|
|
|
<script async>
|
|
loadScript('inline_defer.js');
|
|
</script>
|
|
|
|
<script id=inline_defer>
|
|
// inline script should ignore defer and async attributes. If we don't do
|
|
// this correctly, we'd end up in an infinite loop
|
|
// https://github.com/lightpanda-io/browser/issues/1014
|
|
testing.eventually(() => testing.expectEqual(2, dyn1_loaded));
|
|
</script>
|