tor-browser

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

inline-script.html (1396B)


      1 <!DOCTYPE html>
      2 <head>
      3  <script src="/resources/testharness.js"></script>
      4  <script src="/resources/testharnessreport.js"></script>
      5  <script src="/common/get-host-info.sub.js"></script>
      6  <script src="../../resources/test-initiator.js"></script>
      7 
      8 </head>
      9 <body>
     10  <h1>Description</h1>
     11  <p> This test verifies that, for resources including an
     12      iframe, that are loaded by an inline script, the
     13      initiatorUrl is properly reported.
     14  </p>
     15 </body>
     16 <script>
     17 
     18  const label = "no_cache_inline_script";
     19 
     20  var ifr = document.createElement("iframe");
     21  document.body.appendChild(ifr);
     22  ifr.src = "resources/blank_page_green.html?" + label;
     23 
     24  const link = document.createElement("link");
     25  link.rel = "stylesheet";
     26  link.href = "../../resources/empty_style.css?" + label;
     27  document.head.appendChild(link);
     28 
     29  const img = document.createElement("img");
     30  img.src = "/images/blue.png?" + label;
     31  document.body.appendChild(img);
     32 
     33  const resources = [
     34    "blank_page_green.html?" + label,
     35    "empty_style.css?" + label,
     36    "blue.png?" + label,
     37  ];
     38 
     39  const hostInfo = get_host_info();
     40  const expectedInitiatorUrl = hostInfo["ORIGIN"] +
     41    "/resource-timing/tentative/initiator-url/inline-script.html";
     42 
     43  for (const resource of resources) {
     44    initiator_url_test(resource, expectedInitiatorUrl, resource+
     45      " initiatorUrl from inline-script", resource+" timeout");
     46  }
     47 
     48 </script>