tor-browser

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

about-blank-subresource.https.html (1311B)


      1 <!DOCTYPE html>
      2 <head>
      3  <script src="/resources/testharness.js"></script>
      4  <script src="/resources/testharnessreport.js"></script>
      5  <script src="/cookies/resources/cookie-helper.sub.js"></script>
      6 </head>
      7 <body onload="doTests()">
      8  <script>
      9  function doTests() {
     10    promise_test(async function(t) {
     11      var child = window.open("");
     12      child.onmessage = (ev) => {
     13        child.opener.postMessage(ev.data, '*');
     14      };
     15      var grandKid = child.document.createElement("iframe");
     16      child.document.body.appendChild(grandKid);
     17      var value = "" + Math.random();
     18      await resetSameSiteCookies(SECURE_ORIGIN, value);
     19 
     20      // Load at what cookies a subresource below an about:blank iframe
     21      // inheritting this origin gets.
     22      grandKid.src = SECURE_ORIGIN + "/cookies/samesite/resources/iframe-subresource-report.html"
     23      var e = await wait_for_message("COOKIES", SECURE_ORIGIN);
     24      assert_cookie(SECURE_ORIGIN, e.data, "samesite_unspecified", value, true);
     25      assert_cookie(SECURE_ORIGIN, e.data, "samesite_lax", value, true);
     26      assert_cookie(SECURE_ORIGIN, e.data, "samesite_strict", value, true);
     27      assert_cookie(SECURE_ORIGIN, e.data, "samesite_none", value, true);
     28    }, "SameSite cookies on subresource of top-level about:blank window");
     29  }
     30  </script>
     31 </body>