tor-browser

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

fetch_worker_script.js (545B)


      1 function my_ok(v, msg) {
      2  postMessage({ type: "ok", value: v, msg });
      3 }
      4 
      5 function finish() {
      6  postMessage("finish");
      7 }
      8 
      9 function expectAsyncResult() {
     10  postMessage("expect");
     11 }
     12 
     13 expectAsyncResult();
     14 try {
     15  var success = false;
     16  importScripts("nonexistent_imported_script.js");
     17 } catch (x) {}
     18 
     19 my_ok(success, "worker imported script should be intercepted");
     20 finish();
     21 
     22 function check_intercepted_script() {
     23  success = true;
     24 }
     25 
     26 importScripts("fetch_tests.js");
     27 
     28 finish(); //corresponds to the gExpected increment before creating this worker