tor-browser

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

ancestor-throttle-inner.https.html (1018B)


      1 <!DOCTYPE html>
      2 <html>
      3 <script src="utils.js"></script>
      4 <script src="/common/get-host-info.sub.js"></script>
      5 <title>Header Inheritance Inner Page</title>
      6 <body>
      7 <script>
      8 // This file is embedded in a fenced frame by ancestor-throttle.https.html.
      9 // This is an intermediate step that embeds another page in an iframe to check
     10 // that the child page only checks up to this page's origin when deciding
     11 // if it should load.
     12 async function init() {
     13  const [ancestor_key, embed_url, cross_origin_iframe] =
     14      parseKeylist();
     15  // The URL will be ancestor-throttle-iframe-*.https.html
     16  let iframe_url;
     17  if (cross_origin_iframe == "true") {
     18    iframe_url = generateURL(new URL(embed_url,
     19        get_host_info().HTTPS_REMOTE_ORIGIN), parseKeylist());
     20  } else {
     21    iframe_url = generateURL(new URL(embed_url,
     22        get_host_info().HTTPS_ORIGIN), parseKeylist());
     23  }
     24 
     25  const iframe = document.createElement('iframe');
     26  iframe.src = iframe_url;
     27  document.body.append(iframe);
     28 }
     29 
     30 init();
     31 </script>
     32 </body>
     33 </html>