tor-browser

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

about-blank-window.html (975B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>about:blank in auxiliary browsing context aliases security origin</title>
      5    <script src="/resources/testharness.js"></script>
      6    <script src="/resources/testharnessreport.js"></script>
      7  </head>
      8  <body>
      9    <script>
     10      test(() => {
     11        let newWindow = window.open();
     12        // Should not throw: the newly-opened window should be same-origin.
     13        newWindow.document.body.innerHTML = '<p>Hello world!</p>';
     14 
     15        // Explicitly set `domain` component of origin: any other same-origin
     16        // browsing contexts are now cross-origin unless they also explicitly
     17        // set document.domain to the same value.
     18        document.domain = document.domain;
     19        // Should not throw: the origin should be aliased, so setting
     20        // document.domain in one Document should affect both Documents.
     21        assert_equals(newWindow.document.body.textContent, 'Hello world!');
     22      });
     23    </script>
     24  </body>
     25 </html>