tor-browser

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

WebDriverProcessDataParent.sys.mjs (1085B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 const lazy = {};
      6 
      7 ChromeUtils.defineESModuleGetters(lazy, {
      8  Log: "chrome://remote/content/shared/Log.sys.mjs",
      9 });
     10 
     11 ChromeUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
     12 
     13 /**
     14 * Register the WebDriverProcessData actor that holds session data.
     15 */
     16 export function registerProcessDataActor() {
     17  try {
     18    ChromeUtils.registerProcessActor("WebDriverProcessData", {
     19      kind: "JSProcessActor",
     20      child: {
     21        esModuleURI:
     22          "chrome://remote/content/shared/webdriver/process-actors/WebDriverProcessDataChild.sys.mjs",
     23      },
     24      includeParent: true,
     25    });
     26  } catch (e) {
     27    if (e.name === "NotSupportedError") {
     28      lazy.logger.warn(`WebDriverProcessData actor is already registered!`);
     29    } else {
     30      throw e;
     31    }
     32  }
     33 }
     34 
     35 export function unregisterProcessDataActor() {
     36  ChromeUtils.unregisterProcessActor("WebDriverProcessData");
     37 }