tor-browser

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

test_bug_1873417.html (996B)


      1 <!DOCTYPE html>
      2 <meta charset=utf-8>
      3 <title>Bug 1873417: Test if import-maps will block module script execution</title>
      4 
      5 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6 <script>
      7   (function () {
      8       const script = document.createElement('script');
      9       script.type = 'importmap';
     10       script.textContent = '{}';
     11       document.head.appendChild(script);
     12   }());
     13 </script>
     14 
     15 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     16 
     17 <script>
     18 let hasError = false;
     19 var state;
     20 
     21 SimpleTest.waitForExplicitFinish();
     22 
     23 // eslint-disable-next-line no-unused-vars
     24 function scriptError() {
     25  hasError = true;
     26 }
     27 
     28 // eslint-disable-next-line no-unused-vars
     29 function testLoaded() {
     30  ok(!hasError, 'module script should be loaded');
     31  info("state:" + state);
     32  ok(state === "loaded", "'state' should be set to 'loaded'");
     33  SimpleTest.finish();
     34 }
     35 
     36 </script>
     37 
     38 <body onload="testLoaded()">
     39 <script src="bug_1873417.mjs" type="module" onerror="scriptError()"></script>
     40 </body>