devtools/startup/AboutDebuggingRegistration.jsm
author Butkovits Atila <abutkovits@mozilla.com>
Sun, 18 Apr 2021 08:31:26 +0000
changeset 576467 7f8d1b667187916539f125e511dea2aca7745d4b
parent 554094 265970bfef8ce8b51abf5677ecd5f00bd01d9c4c
permissions -rw-r--r--
Bug 1705193 - disable text-overflow-022.html on Mac for frequent failures. r=aryx DONTBUILD Differential Revision: https://phabricator.services.mozilla.com/D112482

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

// Register the about:debugging URL, that allows to debug tabs, extensions, workers on
// the current instance of Firefox or on a remote Firefox.
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");

const { nsIAboutModule } = Ci;

function AboutDebugging() {}

AboutDebugging.prototype = {
  classDescription: "about:debugging",
  classID: Components.ID("1060afaf-dc9e-43da-8646-23a2faf48493"),
  contractID: "@mozilla.org/network/protocol/about;1?what=debugging",

  QueryInterface: ChromeUtils.generateQI([nsIAboutModule]),

  newChannel: function(_, loadInfo) {
    const chan = Services.io.newChannelFromURIWithLoadInfo(
      Services.io.newURI("chrome://devtools/content/aboutdebugging/index.html"),
      loadInfo
    );
    chan.owner = Services.scriptSecurityManager.getSystemPrincipal();
    return chan;
  },

  getURIFlags: function(uri) {
    return nsIAboutModule.ALLOW_SCRIPT;
  },

  getChromeURI: function(_uri) {
    return Services.io.newURI(
      "chrome://devtools/content/aboutdebugging/index.html"
    );
  },
};

var EXPORTED_SYMBOLS = ["AboutDebugging"];