tor-browser

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

area-navigate.html (1532B)


      1 <!DOCTYPE html>
      2 <!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
      3 <html>
      4  <head>
      5    <title>Area Link messaging - cross-origin Area Link navigation</title>
      6    <script src="/resources/testharness.js"></script>
      7    <script src="/resources/testharnessreport.js"></script>
      8    <!-- Common global functions for referrer-policy tests. -->
      9    <script src="/common/security-features/resources/common.sub.js"></script>
     10  </head>
     11  <body>
     12    <h1>Area Link messaging - cross-origin Area Link navigation</h1>
     13    <p>If you can read JSON encoded HTTP request headers of the Area link below,
     14       the messaging works as expected.</p>
     15 
     16    <pre id="received_message">Running...</pre>
     17 
     18    <script>
     19      promise_test(function() {
     20          var urlPath = '/common/security-features/subresource/document.py';
     21          var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
     22                    urlPath;
     23          return requestViaArea(url)
     24            .then(function(message) {
     25              var pre = document.getElementById('received_message')
     26              var headers = message.headers;
     27              pre.innerHTML = "";
     28              pre.innerHTML += url + ":\n\n";
     29              pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
     30              assert_own_property(headers, "host")
     31              assert_own_property(headers, "connection")
     32            });
     33        },
     34        "Area is responding with HTTP headers");
     35    </script>
     36 
     37    <div id="log"></div>
     38  </body>
     39 </html>