tor-browser

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

blocking_install_event_worker.js (589B)


      1 function postMessageToTest(msg) {
      2  return clients.matchAll({ includeUncontrolled: true }).then(list => {
      3    for (var client of list) {
      4      if (client.url.endsWith("test_install_event_gc.html")) {
      5        client.postMessage(msg);
      6        break;
      7      }
      8    }
      9  });
     10 }
     11 
     12 addEventListener("install", evt => {
     13  // This must be a simple promise to trigger the CC failure.
     14  evt.waitUntil(new Promise(function () {}));
     15  postMessageToTest({ type: "INSTALL_EVENT" });
     16 });
     17 
     18 addEventListener("message", evt => {
     19  if (evt.data.type === "ping") {
     20    postMessageToTest({ type: "pong" });
     21  }
     22 });