Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 24ae4ca

Browse files
Bug 1512454 - Register about:debugging-new for Nightly builds;r=ladybenko,Ola
Differential Revision: https://phabricator.services.mozilla.com/D13923 --HG-- extra : moz-landing-system : lando
1 parent 08226e3 commit 24ae4ca

5 files changed

Lines changed: 56 additions & 0 deletions

File tree

browser/components/contextualidentity/test/browser/browser_aboutURLs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ add_task(async function() {
1818
"downloads",
1919
// about:debugging requires specific wait code for internal pending RDP requests.
2020
"debugging",
21+
"debugging-new",
2122
];
2223

2324
for (let cid in Cc) {

browser/installer/package-manifest.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@
184184
@RESPATH@/browser/components/devtools-startup.js
185185
@RESPATH@/browser/components/aboutdebugging-registration.js
186186
@RESPATH@/browser/components/aboutdebugging.manifest
187+
#ifdef NIGHTLY_BUILD
188+
@RESPATH@/browser/components/aboutdebugging-new-registration.js
189+
@RESPATH@/browser/components/aboutdebugging-new.manifest
190+
#endif
187191
@RESPATH@/browser/components/aboutdevtools-registration.js
188192
@RESPATH@/browser/components/aboutdevtools.manifest
189193
@RESPATH@/browser/components/aboutdevtoolstoolbox-registration.js
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
// This component is only registered and packaged for local and nightly builds in order to
8+
// open the new about:debugging when going to about:debugging-new, without having to flip
9+
// the preference. This allows running both versions of about:debugging side by side to
10+
// compare them.
11+
const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", {});
12+
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm", {});
13+
14+
const { nsIAboutModule } = Ci;
15+
16+
function AboutDebuggingNew() {}
17+
18+
AboutDebuggingNew.prototype = {
19+
classDescription: "about:debugging-new",
20+
classID: Components.ID("610e4e26-26bd-4a7d-aebc-69211d5a3be0"),
21+
contractID: "@mozilla.org/network/protocol/about;1?what=debugging-new",
22+
23+
QueryInterface: ChromeUtils.generateQI([nsIAboutModule]),
24+
25+
newChannel: function(_, loadInfo) {
26+
const uri = "chrome://devtools/content/aboutdebugging-new/index.html";
27+
28+
const chan = Services.io.newChannelFromURIWithLoadInfo(
29+
Services.io.newURI(uri),
30+
loadInfo
31+
);
32+
chan.owner = Services.scriptSecurityManager.getSystemPrincipal();
33+
return chan;
34+
},
35+
36+
getURIFlags: function(uri) {
37+
return nsIAboutModule.ALLOW_SCRIPT;
38+
},
39+
};
40+
41+
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
42+
AboutDebuggingNew,
43+
]);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
component {610e4e26-26bd-4a7d-aebc-69211d5a3be0} aboutdebugging-new-registration.js
2+
contract @mozilla.org/network/protocol/about;1?what=debugging-new {610e4e26-26bd-4a7d-aebc-69211d5a3be0}

devtools/startup/moz.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ if CONFIG['MOZ_DEVTOOLS'] == 'all':
2626
'locales',
2727
]
2828

29+
if CONFIG['NIGHTLY_BUILD']:
30+
EXTRA_COMPONENTS += [
31+
'aboutdebugging-new-registration.js',
32+
'aboutdebugging-new.manifest',
33+
]
34+
2935
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
3036

3137
if CONFIG['MOZ_BUILD_APP'] != 'mobile/android':

0 commit comments

Comments
 (0)