2017-10-04 13:16:37 +00:00
|
|
|
/* 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:devtools URL, that is opened whenever a user attempts to open
|
|
|
|
// DevTools for the first time.
|
2018-02-07 09:37:36 +00:00
|
|
|
const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", {});
|
|
|
|
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm", {});
|
2017-10-04 13:16:37 +00:00
|
|
|
|
|
|
|
const { nsIAboutModule } = Ci;
|
|
|
|
|
|
|
|
function AboutDevtools() {}
|
|
|
|
|
|
|
|
AboutDevtools.prototype = {
|
2018-03-12 13:41:48 +00:00
|
|
|
uri: Services.io.newURI("chrome://devtools-startup/content/aboutdevtools/aboutdevtools.xhtml"),
|
2017-10-04 13:16:37 +00:00
|
|
|
classDescription: "about:devtools",
|
|
|
|
classID: Components.ID("3a16d383-92bd-4c24-ac10-0e2bd66883ab"),
|
|
|
|
contractID: "@mozilla.org/network/protocol/about;1?what=devtools",
|
|
|
|
|
2018-04-23 03:55:06 +00:00
|
|
|
QueryInterface: ChromeUtils.generateQI([nsIAboutModule]),
|
2017-10-04 13:16:37 +00:00
|
|
|
|
2018-03-12 18:24:38 +00:00
|
|
|
newChannel: function(uri, loadInfo) {
|
2018-06-01 10:36:09 +00:00
|
|
|
const chan = Services.io.newChannelFromURIWithLoadInfo(
|
2017-10-04 13:16:37 +00:00
|
|
|
this.uri,
|
|
|
|
loadInfo
|
|
|
|
);
|
|
|
|
chan.owner = Services.scriptSecurityManager.getSystemPrincipal();
|
|
|
|
return chan;
|
|
|
|
},
|
|
|
|
|
2018-03-12 18:24:38 +00:00
|
|
|
getURIFlags: function(uri) {
|
2017-10-04 13:16:37 +00:00
|
|
|
return nsIAboutModule.ALLOW_SCRIPT;
|
2018-10-19 12:55:39 +00:00
|
|
|
},
|
2017-10-04 13:16:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
|
2018-10-19 12:55:39 +00:00
|
|
|
AboutDevtools,
|
2017-10-04 13:16:37 +00:00
|
|
|
]);
|