tor-browser

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

coop-csp-sandbox.https.html (978B)


      1 <!doctype html>
      2 <title>CSP sandboxed Cross-Origin-Opener-Policy popup should result in a network error</title>
      3 <script src=/resources/testharness.js></script>
      4 <script src=/resources/testharnessreport.js></script>
      5 <script src="/common/utils.js"></script> <!-- Use token() to allow running tests in parallel -->
      6 <div id=log>
      7 <script>
      8 [
      9  "allow-popups allow-scripts allow-same-origin",
     10  "allow-popups allow-scripts",
     11 ].forEach(sandboxValue => {
     12  async_test(t => {
     13    const channel = new BroadcastChannel(token());
     14    channel.onmessage = t.unreached_func("A COOP popup was created from a CSP-sandboxed popup");
     15    const popup = window.open(`resources/csp-sandbox.py?coop=same-origin&coep=&sandbox=${sandboxValue}&channel=${channel.name}`);
     16    t.add_cleanup(() => { popup.close(); });
     17    addEventListener('load', t.step_func(() => {
     18      t.step_timeout(() => {
     19        t.done()
     20      }, 1500);
     21    }));
     22  }, `CSP: sandbox ${sandboxValue}; ${document.title}`);
     23 });
     24 </script>