tor-browser

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

opener-noreferrer.html (1058B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>Auxiliary Browsing Contexts: window.opener noreferrer</title>
      5    <script src="/resources/testharness.js"></script>
      6    <script src="/resources/testharnessreport.js"></script>
      7    <script src="/common/PrefixedLocalStorage.js"></script>
      8  </head>
      9  <body>
     10    <div id="log"></div>
     11    <script>
     12    var prefixedLocalStorage;
     13    setup(() => prefixedLocalStorage = new PrefixedLocalStorageTest());
     14    async_test(t => {
     15      t.add_cleanup(() => prefixedLocalStorage.cleanup());
     16      var a       = document.createElement('a');
     17      a.href      = prefixedLocalStorage.url('resources/no-opener.html');
     18      a.target    = '_blank';
     19      a.rel       = 'noreferrer';
     20      window.name = 'topWindow';
     21      document.body.appendChild(a);
     22      prefixedLocalStorage.onSet('openerIsNull', t.step_func_done(e => {
     23        assert_equals(e.newValue, 'true');
     24      }));
     25      a.click();
     26    }, 'Auxiliary browsing context created with `rel="noreferrer"` should report `window.opener` `null`');
     27    </script>
     28  </body>
     29 </html>