tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

script-inserted-inline-module-with-import.html (859B)


      1 <!DOCTYPE html>
      2 <head>
      3 <title>Script-inserted module script elements with "blocking=render" are render-blocking</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script>
      7  window.did_execute_script = false;
      8  const script = document.createElement("script");
      9  script.type = "module";
     10  script.blocking = "render";
     11  script.textContent = `
     12    import "/loading/resources/dummy.js?pipe=trickle(d1)";
     13    window.did_execute_script = true;
     14  `;
     15  document.head.append(script);
     16 </script>
     17 </head>
     18 <div id="dummy">some text</div>
     19 
     20 <script>
     21    promise_test(async t => {
     22      await new Promise(resolve => requestAnimationFrame(() => resolve()));
     23      assert_true(window.did_execute_script, "Script-inserted render-blocking inline module script should execute before rAF callback");
     24    });
     25 </script>