tor-browser

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

removing-iframes.sub.https.html (1568B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>A site-keyed child at a given origin causes future children to also be site-keyed even after the iframe is removed</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 
      7 <div id="log"></div>
      8 
      9 <script type="module">
     10 import {
     11  insertIframe,
     12  testSameAgentCluster,
     13  testDifferentAgentClusters,
     14  testGetter
     15 } from "./resources/helpers.mjs";
     16 
     17 let frame1;
     18 promise_setup(async () => {
     19  frame1 = await insertIframe("{{hosts[][www]}}");
     20 });
     21 
     22 // Since they're different-origin, the parent's origin-keying request is
     23 // respected, as is the child's non-request. So the parent ends up in the
     24 // origin-keyed agent cluster and the child ends up in the site-keyed one.
     25 testDifferentAgentClusters([self, 0], "Before");
     26 testGetter(self, true, "parent");
     27 testGetter(0, false, "child1");
     28 
     29 promise_test(async () => {
     30  frame1.remove();
     31 
     32  await insertIframe("{{hosts[][www]}}", "?1");
     33  await insertIframe("{{hosts[][www1]}}");
     34 }, "Remove the iframe and insert new ones");
     35 
     36 // Because of the historical presence of a site-keyed {{hosts[][www]}} iframe,
     37 // the origin-keying request for child 2 will be ignored. So,
     38 // child 2 and child 3 both end up in the site-keyed agent cluster.
     39 testDifferentAgentClusters([self, 0], "Parent to child2");
     40 testDifferentAgentClusters([self, 1], "Parent to child3");
     41 testSameAgentCluster([0, 1], "child2 to child3");
     42 testSameAgentCluster([1, 0], "child3 to child2");
     43 
     44 testGetter(0, false, "child2");
     45 testGetter(1, false, "child3");
     46 </script>