tor-browser

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

AboutDebuggingRegistration.sys.mjs (1173B)


      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 { nsIAboutModule } = Ci;
      6 
      7 /**
      8 * Register the about:debugging URL, that allows to debug tabs, extensions, workers on
      9 * the current instance of Firefox or on a remote Firefox.
     10 */
     11 export class AboutDebugging {
     12  classDescription = "about:debugging";
     13  classID = Components.ID("1060afaf-dc9e-43da-8646-23a2faf48493");
     14  contractID = "@mozilla.org/network/protocol/about;1?what=debugging";
     15 
     16  QueryInterface = ChromeUtils.generateQI([nsIAboutModule]);
     17 
     18  newChannel(_, loadInfo) {
     19    const chan = Services.io.newChannelFromURIWithLoadInfo(
     20      Services.io.newURI("chrome://devtools/content/aboutdebugging/index.html"),
     21      loadInfo
     22    );
     23    chan.owner = Services.scriptSecurityManager.getSystemPrincipal();
     24    return chan;
     25  }
     26 
     27  getURIFlags() {
     28    return nsIAboutModule.ALLOW_SCRIPT | nsIAboutModule.IS_SECURE_CHROME_UI;
     29  }
     30 
     31  getChromeURI(_uri) {
     32    return Services.io.newURI(
     33      "chrome://devtools/content/aboutdebugging/index.html"
     34    );
     35  }
     36 }