Files
palemoon27/toolkit/devtools/gcli/commands/tools.js
T
roytam1 bfa8452350 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1084525 - Part 2: Refactor expectState from memory-bridge.js to common.js r=fitzgen (241c8d7cd)
- Bug 1084525 - Part 3: Add attach and detach methods to PromisesActor r=fitzgen (df0dea46d)
- Avoid infinite recursion when lazy-loading devtools modules and stepping into promise code in chrome debugging (bug 1149910). r=jlongster,fitzgen (a8e372285)
- Bug 1136341 - fix source actors representing inline scripts in XUL files so breakpoints work r=ejpbruel (904825023)
- Bug 1158498 - Can't set a JS breakpoint in inline JS;r=jlong (bbf9200ed)
- Bug 1166844 - treat eval'ed code from the console as unnamed eval sources r=ejpbruel (98d19de4e)
- Bug 1166852 - handle named eval sources from the console correctly r=ejpbruel (447b21b07)
- Bug 1163024 - Part 1: Stylesheet actors should use the common DevToolsUtils.fetch(). r=bgrins (2871b6295)
- Bug 1148893 - Miscellaneous fixes to multiple style editor tests. r=bgrins (073392349)
- Bug 1150005 - Don't wait for "editor-selected" event in browser_styleeditor_fetch-from-cache.js as it may have already been emitted. r=bgrins (c68786780)
- Bug 1163024 - Part 2: Ignore network requests from chrome code in a content toolbox. r=ochameau (6fd22227c)
- fix misspatch? (f1c0c1012)
- Bug 1161072 - Destroy inspector actor on disconnect. r=pbrosset (62bc54dfe)
- Bug 1168088 - Remove SpiderMonkey-specific syntax from toolkit/devtools. r=pbrosset (1f177ae4b)
- Bug 1134568 - Implement a preset gallery for CubicBezierWidget incl. 8 preset functions for categories: ease-in, ease-out, and ease-in-out. r=pbrosset (3ae37e757)
- Bug 1055181 - Mochitests for the CSS Filter tooltip; r=pbrosset (981c13b02)
- Bug 1149671 - Use alt/na/shift to step 0.1/1/10 at a time. r=pbrosset (fd70b5f1b)
- Bug 1126457 - Implement a worker utility to easily offload tasks into a worker. r=bgrins (2681ad8a1)
- fix misspatch (7afd26b57)
2021-04-17 08:04:03 +08:00

101 lines
3.1 KiB
JavaScript

/* 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";
const { Cc, Ci, Cu } = require("chrome");
const Services = require("Services");
const { OS } = require("resource://gre/modules/osfile.jsm");
const { devtools } = require("resource://gre/modules/devtools/Loader.jsm");
const gcli = require("gcli/index");
const l10n = require("gcli/l10n");
const BRAND_SHORT_NAME = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService)
.createBundle("chrome://branding/locale/brand.properties")
.GetStringFromName("brandShortName");
exports.items = [
{
name: "tools",
description: l10n.lookupFormat("toolsDesc2", [ BRAND_SHORT_NAME ]),
manual: l10n.lookupFormat("toolsManual2", [ BRAND_SHORT_NAME ]),
get hidden() {
return gcli.hiddenByChromePref();
}
},
{
item: "command",
runAt: "client",
name: "tools srcdir",
description: l10n.lookup("toolsSrcdirDesc"),
manual: l10n.lookupFormat("toolsSrcdirManual2", [ BRAND_SHORT_NAME ]),
get hidden() {
return gcli.hiddenByChromePref();
},
params: [
{
name: "srcdir",
type: "string" /* {
name: "file",
filetype: "directory",
existing: "yes"
} */,
description: l10n.lookup("toolsSrcdirDir")
}
],
returnType: "string",
exec: function(args, context) {
let clobber = OS.Path.join(args.srcdir, "CLOBBER");
return OS.File.exists(clobber).then(function(exists) {
if (exists) {
let str = Cc["@mozilla.org/supports-string;1"]
.createInstance(Ci.nsISupportsString);
str.data = args.srcdir;
Services.prefs.setComplexValue("devtools.loader.srcdir",
Ci.nsISupportsString, str);
devtools.reload();
let msg = l10n.lookupFormat("toolsSrcdirReloaded", [ args.srcdir ]);
throw new Error(msg);
}
return l10n.lookupFormat("toolsSrcdirNotFound", [ args.srcdir ]);
});
}
},
{
item: "command",
runAt: "client",
name: "tools builtin",
description: l10n.lookup("toolsBuiltinDesc"),
manual: l10n.lookup("toolsBuiltinManual"),
get hidden() {
return gcli.hiddenByChromePref();
},
returnType: "string",
exec: function(args, context) {
Services.prefs.clearUserPref("devtools.loader.srcdir");
devtools.reload();
return l10n.lookup("toolsBuiltinReloaded");
}
},
{
item: "command",
runAt: "client",
name: "tools reload",
description: l10n.lookup("toolsReloadDesc"),
get hidden() {
return gcli.hiddenByChromePref() ||
!Services.prefs.prefHasUserValue("devtools.loader.srcdir");
},
returnType: "string",
exec: function(args, context) {
devtools.reload();
return l10n.lookup("toolsReloaded2");
}
}
];