tor-browser

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

notification_worker_child-parent.js (629B)


      1 function ok(test, message) {
      2  postMessage({ type: "ok", test, message });
      3 }
      4 
      5 function is(a, b, message) {
      6  postMessage({ type: "is", test1: a, test2: b, message });
      7 }
      8 
      9 if (self.Notification) {
     10  var child = new Worker("notification_worker_child-child.js");
     11  child.onerror = function (e) {
     12    ok(false, "Error loading child worker " + e);
     13    postMessage({ type: "finish" });
     14  };
     15 
     16  child.onmessage = function (e) {
     17    postMessage(e.data);
     18  };
     19 
     20  onmessage = () => {
     21    child.postMessage("start");
     22  };
     23 } else {
     24  ok(true, "Notifications are not enabled in workers on the platform.");
     25  postMessage({ type: "finish" });
     26 }