tor-browser

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

UtilsParent.mjs (478B)


      1 /**
      2 * Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/publicdomain/zero/1.0/
      4 */
      5 
      6 import { Utils } from "./Utils.mjs";
      7 
      8 export const UtilsParent = {
      9  async OnMessageReceived(worker, msg) {
     10    switch (msg.op) {
     11      case "getCachedOriginUsage": {
     12        const result = await Utils.getCachedOriginUsage();
     13        worker.postMessage(result);
     14        break;
     15      }
     16 
     17      default:
     18        throw new Error(`Unknown op ${msg.op}`);
     19    }
     20  },
     21 };