tor-browser

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

third-party-cookies-cross-site-popup.html (1253B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8" />
      3 <meta name="timeout" content="long">
      4 <title>Cross-site popup</title>
      5 <script src="/resources/testdriver.js"></script>
      6 <script src="/resources/testdriver-vendor.js"></script>
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/common/get-host-info.sub.js"></script>
      9 <script src="/cookies/resources/cookie-helper.sub.js"></script>
     10 <script src="/cookies/third-party-cookies/resources/test-helpers.js"></script>
     11 
     12 <body>
     13  <button id="button" onclick="userInteractionCallback()">Click for user interaction</button>
     14 
     15  <script>
     16    const origin = window.origin;
     17    const crossSiteOrigin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN + self.location.pathname;
     18 
     19    function userInteractionCallback() {
     20      // Third-party cookies are now allowed.
     21      const verify3pAllowedUrl = new URL(
     22        `./third-party-cookies-cross-site-popup-verify.html?desc=3P_fetch_with_heuristics&origin=${encodeURIComponent(origin)}`,
     23        crossSiteOrigin);
     24      const verify3pAllowedPopup = window.open(verify3pAllowedUrl);
     25      fetch_tests_from_window(verify3pAllowedPopup);
     26    };
     27 
     28    test_driver.set_test_context(window.opener.opener);
     29    test_driver.click(document.getElementById("button"));
     30 
     31  </script>
     32 </body>