tor-browser

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

aboutPageProcessScript.js (999B)


      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 "use strict";
      6 
      7 // Note: This script is used only when a static registration for our
      8 // component is not already present in the libxul binary.
      9 
     10 const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
     11 
     12 const classID = Components.ID("{97bf9550-2a7b-11e9-b56e-0800200c9a66}");
     13 
     14 if (!Cm.isCIDRegistered(classID)) {
     15  const { ComponentUtils } = ChromeUtils.importESModule(
     16    "resource://gre/modules/ComponentUtils.sys.mjs"
     17  );
     18 
     19  const factory = ComponentUtils.generateSingletonFactory(function () {
     20    const { AboutCompat } = ChromeUtils.importESModule(
     21      "resource://webcompat/AboutCompat.sys.mjs"
     22    );
     23    return new AboutCompat();
     24  });
     25 
     26  Cm.registerFactory(
     27    classID,
     28    "about:compat",
     29    "@mozilla.org/network/protocol/about;1?what=compat",
     30    factory
     31  );
     32 }