tor-browser

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

accept-ch.wildcard.https.sub.html (925B)


      1 <!DOCTYPE html>
      2 <body>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script>
      6 // Here's the set-up for this test:
      7 // Step 1 (top-frame) Embeds a cross-origin iframe.
      8 // Step 2 (sub-frame) Make a cross-origin POST request.
      9 // Step 3 (sub-frame) Checks if platform version header is present and alerts top frame.
     10 // Step 4 (top-frame) Asserts header was present and returns.
     11 async_test(t => {
     12    // Step 4
     13    window.addEventListener("message", t.step_func(e => {
     14        assert_equals(e.data, "HadPlatformVersion");
     15        t.done();
     16    }));
     17 
     18    // Step 1
     19    let iframe = document.createElement("iframe");
     20    iframe.src = "https://{{domains[www1]}}:{{ports[https][0]}}/client-hints/resources/accept-ch.wildcard.iframe.https.sub.html";
     21    document.body.appendChild(iframe);
     22 }, "Accept-CH with wildcard policy and iframe subresource");
     23 </script>
     24 </body>
     25 </html>