tor-browser

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

UtilsChild.mjs (547B)


      1 /**
      2 * Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/publicdomain/zero/1.0/
      4 */
      5 
      6 export const UtilsChild = {
      7  async getCachedOriginUsage() {
      8    postMessage({
      9      moduleName: "UtilsParent",
     10      objectName: "UtilsParent",
     11      op: "getCachedOriginUsage",
     12    });
     13 
     14    return new Promise(function (resolve) {
     15      addEventListener("message", async function onMessage(event) {
     16        removeEventListener("message", onMessage);
     17        const data = event.data;
     18        resolve(data);
     19      });
     20    });
     21  },
     22 };