tor-browser

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

static-after-innerText.html (828B)


      1 <!DOCTYPE html>
      2 <html>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script type="importmap" id="importMap">
      6 {
      7  "imports": {
      8    "./resources/log.js?pipe=sub&name=A": "./resources/log.js?pipe=sub&name=B"
      9  }
     10 }
     11 </script>
     12 <script>
     13 const log = [];
     14 
     15 promise_test(() => {
     16  // Import maps are static. Changing their innerText does not change the import
     17  // map entry.
     18  const importMap = document.getElementById("importMap");
     19  importMap.innerText = "";
     20 
     21  // The following should succeed as if the above lines did nothing.
     22  return import("./resources/log.js?pipe=sub&name=A")
     23    .then(() => import("./resources/log.js?pipe=sub&name=B"))
     24    .then(() => assert_array_equals(log, ["log:B"]))
     25  },
     26  "Module map's key is the URL after import map resolution");
     27 </script>