tor-browser

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

script-src-allow.sub.js (781B)


      1 importScripts("{{location[server]}}/resources/testharness.js");
      2 
      3 test(t => {
      4  importScripts("https://{{hosts[][www]}}:{{ports[https][1]}}" +
      5                "/content-security-policy/support/testharness-helper.js");
      6 }, "Cross-origin `importScripts()` not blocked in " + self.location.protocol +
      7     " withour CSP");
      8 
      9 test(t => {
     10  assert_equals(2, eval("1+1"));
     11  assert_equals(2, (new Function("return 1+1;"))());
     12 }, "`eval()` not blocked in " + self.location.protocol +
     13    " without CSP");
     14 
     15 async_test(t => {
     16  self.callback = t.step_func_done();
     17 
     18  setTimeout("self.callback();", 1);
     19  setTimeout(t.step_func(_ =>
     20      assert_unreached("callback not called.")), 2);
     21 }, "`setTimeout([string])` not blocked in " + self.location.protocol +
     22           " without CSP");
     23 
     24 done();