tor-browser

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

csp-script-src-strict-dynamic.https.html (1108B)


      1 <!DOCTYPE html>
      2 <meta name="variant" content="?target_hint=_self">
      3 <meta name="variant" content="?target_hint=_blank">
      4 <meta name="timeout" content="long">
      5 <script src="/common/utils.js"></script>
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="../resources/utils.js"></script>
      9 <script src="resources/utils.js"></script>
     10 
     11 <body>
     12 <script>
     13 setup(() => assertSpeculationRulesIsSupported());
     14 
     15 promise_test(async t => {
     16  // The key used for storing a test result in the server.
     17  const key = token();
     18 
     19  // Open the test runner in a popup - it will prerender itself, record the
     20  // test results, and send them back to this harness.
     21  const url =
     22    `resources/csp-script-src-strict-dynamic.html?key=${key}&target_hint=${getTargetHint()}`;
     23  window.open(url, '_blank', 'noopener');
     24 
     25  // Wait until the test sends us the results.
     26  const result = await nextValueFromServer(key);
     27 
     28  assert_equals(result, "true", "");
     29 }, 'Test if CSP script-src strict-dynamic allows inline speculationrules injected from the permitted scripts.');
     30 </script>