tor-browser

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

opener-setter.html (1403B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>Auxiliary Browsing Contexts: window.opener setter</title>
      5    <meta name=timeout content=long>
      6    <script src="/resources/testharness.js"></script>
      7    <script src="/resources/testharnessreport.js"></script>
      8    <script src="/common/PrefixedLocalStorage.js"></script>
      9  </head>
     10  <body>
     11    <div id="log"></div>
     12    <script>
     13    var prefixedLocalStorage;
     14    setup(() => prefixedLocalStorage = new PrefixedLocalStorageTest());
     15    async_test(t => {
     16      t.add_cleanup(() => prefixedLocalStorage.cleanup());
     17      prefixedLocalStorage.onSet('openerIsNull', t.step_func_done(e => {
     18        assert_equals(e.newValue, 'true');
     19      }));
     20      window.open(prefixedLocalStorage.url('resources/opener-setter.html'),
     21        'iShouldSetOpenerToNull');
     22    }, 'Auxiliary browsing context created via `window.open` and setting `window.opener` to `null` should report `window.opener` `null`');
     23    async_test(t => {
     24      t.add_cleanup(() => prefixedLocalStorage.cleanup());
     25      prefixedLocalStorage.onSet('openerIsTest', t.step_func_done(e => {
     26        assert_equals(e.newValue, 'true');
     27      }));
     28      window.open(prefixedLocalStorage.url('resources/opener-setter.html'),
     29        'iShouldSetOpenerToTest');
     30    }, 'Auxiliary browsing context created via `window.open` and setting `window.opener` to `test` should report `test`');
     31    </script>
     32  </body>
     33 </html>