mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
ff0033e97d
- Bug 1231975 - Part 3: Break a reference cycle between PendingResolution and DNSRequestChild. r=drno (ecf45de535) - Bug 1231975 - Part 4: Add some logging and simplification in TestNrSocket. r=drno (fa811f7743) - Bug 1231975 - Part 5: Fix an intermittent failure caused by the NAT simulator erroneously canceling NR_ASYNC_WAIT_READ. r=drno (e436a8cc75) - var-let (d228288673) - Bug 1256022 - dom/network slow GC on mochitest fix r=dragana (e0dffd5033) - Bug 1231130 - added mHadLocalInstance to constructor.r=jaas (c4f6d0c530) - Bug 1121290: Use "%ls" instead of "%s" in _snwprintf_s format string# r=bsmedberg (e0434aca5a) - Bug 1206952 - Rename MagicRequest to ByteRangeRequest. r=sicking (6780309aa2) - Bug 1206952 - Convert PluginStreamListener to use channel->AsyncOpen2(). r=sicking (8f41f3e148) - Bug 1262335 - Part 2. Remove Android GB/HC defines from OMX. r=snorp (e5b7435d92) - Bug 956899 - Add a std::condition_variable work-alike; r=froydnj (98076c707e) - Bug 1254123 - Handle OOM more gracefully in js::ErrorToException. (r=Waldo) (f9a2ef18d1) - Bug 1255128 - Standard argument coercion in new ArrayBuffer(length). r=nbp. Thanks to snowmantw for tests. (06e5cedd80) - Bug 1251919 - Nuke Debugger wrappers on failure. (r=shu) (64bc41b1f1) - Bug 1254190 - Propagate failure of matchAllDebuggeeGlobals() in Debugger. (r=shu) (927bf01ec5) - Bug 1254172 - Make UnboxedLayout::makeNativeGroup robust to unknownProperties on unboxed type. (r=jandem) (398a6b3aa7) - Bug 1268213 - BlobImplFile::GetTypeRunnable can be a WorkerMainThreadRunnable, r=khuey (30e4ff4b75) - Bug 1250523 - Wait for the markup-view to be loaded in browser_markup_load_01.js; r=gl (acf9e9d88b) - Bug 1230325 - markup-view: skip keyboard shortcuts if any modifier;r=pbrosset (ab974dfac7) - Bug 1155465 - part1: layout-view: use content-type CSS_VALUE for editors;r=miker (d21e70b811) - Bug 1155465 - part2: inplace-editor: disable increment on up/down for PLAIN_TEXT;r=miker (5d72e05f63) - Bug 1241126 - ruleview property: open editor for prop. name on click on ":";r=gl (4889010c34) - Bug 1128340 - Allow renaming with non-ASCII characters in WebIDE. r=jryans (f9844e3afb) - Bug 1039482 - Properly position and style the file name edit field in the projecteditor. r=bgrins (4c29b80958) - Bug 1268231 - Get rid of StopSyncLoopRunnable, r=khuey (29b0a0ed4f) - Bug 1267904 - Add telemetry for WorkerMainThreadRunnable, r=khuey (970d39bcce) - Bug 1261317 - part1: inplace-editor: small refactor of keypress event handler;r=pbro (5261bca85a) - Bug 1261317 - part2: prevent autocomplete on arrow keys in multiline editor;r=pbro (859738623a) - Bug 1246677 - 1 - Make waitForSuccess work with async functions; r=miker (3927347635) - Bug 1227810 - split browser_ruleview_authored.js into three tests; r=pbrosset (f6e4760908) - Bug 1246677 - 2 - Stop using CPOWs in simulateColorPickerChange; r=miker (69a31024cf) - Bug 1246677 - 3 - Remove all usages of getNode in ruleview tests; r=tromey (2f25bec099) - Bug 1240813 - Fixed the unhandled promise rejections in browser_rules_colorpicker-* tests; r=ochameau (bd534ec71b) - Bug 1217328 - let filter editor work on invalid values. r=pbrosset (91602cac94) - Bug 1225236 - Removed the 360 value limit for the hue-rotate field in the CSS filter popup. r=pbro (9bceb9947d) - Bug 1223076 - make FilterWidget handle "unset", "initial", and "inherit". r=pbrosset (6542d5cc99) - Bug 1221156 - make FilterWidget try to preserve URL quoting; r=pbrosset (3e1105c3d5) - Bug 1226543 - fix URL quoting in CSSFilterEditorWidget.getValueAt. r=pbrosset (1770cc279a) - Bug 1241527 - 1 - Fix some unhandled rejected promises in colorpicker, cubicbezier and cssfilter ruleview tests; r=gl (059df355be) - Bug 1241527 - 2 - Use ruleview-changed event to avoid pending requests when browser_rules_search-filter* tests end; r=gl (407d5866b0) - Bug 1241527 - 3 - Fix typo in hideTooltipAndWaitForRuleviewChanged; r=gl (964270c8c3) - Bug 1241527 - 4 - Use ruleview-changed event to avoid pending requests in browser_rules_multiple* tests; r=gl (2947abf296) - Bug 1241527 - 5 - Use ruleview-changed event to fix remaining pending requests in tests; r=gl (5391857e12) - Bug 1246677 - 4 - Stop using content.getComputedStyle in ruleview tests; r=miker (f61cd8d5aa) - Bug 1237885 - fix add-rules_01 intermittent by splitting in two tests;r=gl (45e4de6012) - Bug 1166956 - add valid unit when incrementing CSS value "0";r=tromey (40ca31b909) - Bug 1241155 - correctly use indexOf in browser_rules_user-agent-styles.js; r=bgrins (0966d23f7e) - Bug 1229911 - recognize DevToolsUtils.defineLazyGetter and defineLazyModuleGetter. r=miker (876e4b9f3b) - Bug 1230093 - Make the import-headjs-globals rule store variables correctly; r=Mossop (be3ddcb7fb) - Bug 1229224: Support more forms of defining globals and make anywhere we import scripts use them too. r=miker (c9a243fcae) - Bug 1231963 - handle top-level "this.mumble" assignments in eslint; r=mikeratcliffe (be07835449) - Bug 1224289 - add eslint rule to reject Cu.importGlobalProperties; r=mikeratcliffe (eac54ddcce) - Bug 1241544 - add documentation for this-top-level-scope eslint rule; r=mikeratcliffe (9d832af29d) - Bug 1239426 - handle arrow functions in getASTSource; r=mikeratcliffe (889b5ff89c) - Bug 1242584 - Remove dead code in import-headjs-globals. r=tromey (e7b07c59b3) - Bug 1229224: Support more forms of defining globals and make anywhere we import scripts use them too. r=miker (cf4a3d4d48) - Bug 1242584 - import-globals-from should carry over to tests. r=tromey (f1f7d7269a) - Bug 1224735 - only emit one error per possible CPOW use; r=miker,Ms2ger (621dba76e1) - Bug 1245916: Unify eslint global discovery rules. r=pbrosset (e80d38e097) - Bug 1246677 - 7 - Clean remaining ruleview and tests eslint warnings; r=jdescottes (9415147b5b) - Bug 1246677 - 5 - Get rid of 'content' in ruleview test files; r=jdescottes (d868fde632) - Bug 1209295 - Ensure browser_rules_add-property-cancel_02.js waits for the correct change notification. r=pbrosset (4099437554) - Bug 1240778 - Fixed the unhandled promise rejection in browser_rules_add-property_01.js; r=ochameau (838bd1f99c) - Bug 1246677 - 8 - Use addProperty and remove code duplication; r=gl (2c33059028) - Bug 1246677 - 9 - Get rid of all remaining _applyingModifications usage in tests; r=ochameau (a9bc3b2495) - Bug 1143742 - part1: multiline inplace editor: cleanup existing tests;r=gl (2bc96e58d3) - Bug 1243695 - ensure caret is visible in ruleview prop editor;r=miker (3353a5a77c) - Bug 1143742 - part2: multiline inplace-editor should support a maxWidth option;r=gl (98809c04cb) - Bug 1178462 - Cancel inplace editor autocomplete on window blur;r=gl (c4af4c03d2) - Bug 1261827 - inplace-editor: copyTextStyles should not copy line-height property;r=pbro (1fc8d7d432) - Bug 1069829 - 1 - Remove a usage of domUtils.cssPropertyIsValid in inplace-editor; r=tromey (7898eed84b) - Bug 1143742 - part3: multiline inplace-editor autocomplete behavior;r=gl (53b369dccb) - Bug 1143742 - part4: add textarea to valid targets when copying;r=gl (84af495716) - Bug 1143742 - part5: fix eslint error in inspector ruleview test;r=bustage (d7a53a6217) - Bug 1249888 - try/catch SourceMapConsumer to avoid empty rule-view when source map is invalid; r=gl (c78a7a6ac7) - Bug 1255787 - Do not assume sourceMap appears only in external stylesheets; r=gl (7c69e1e559) - Bug 1029459 - remove output-parser iteration limit. r=pbrosset (f2438a8642) - Bug 1250835 - Display swatch for angles in the rules panel. r=miker (87721e80f2) - Bug 1259777 - Remove unnecessary DOMUtils lazy load in css-angle.js . r=pbro (e199a014d5) - Bug 1259559 - Units cycling with shift+click persists value in Style editor. r=miker (b7074813e9) - Bug 1245996 - inspector: fix xul scrollbars stealing focus;r=pbro (bcb19ffa83) - Bug 1180349 - Increase the timeout for browser_markupview_links_01.js (b67cd0d2be) - Bug 1253935 - Remove all CPOW usages in styleeditor tests and use ContentTask instead of custom frame-script; r=ochameau (485308e7b1) - Bug 1257246: Update devtools for eslint 2. r=pbro (c04f7f3046) - Bug 1264968 part 2 - Allow persisting attributes of xul:window if its owner document is not root. r=enndeakin (ca8182b534) - Bug 1244948 - silence the 'loaded script twice' warning. r=bz (fa571b837c)
470 lines
17 KiB
JavaScript
470 lines
17 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} = require("chrome");
|
|
const Services = require("Services");
|
|
|
|
loader.lazyGetter(this, "osString", () => Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS);
|
|
|
|
// Panels
|
|
loader.lazyGetter(this, "OptionsPanel", () => require("devtools/client/framework/toolbox-options").OptionsPanel);
|
|
loader.lazyGetter(this, "InspectorPanel", () => require("devtools/client/inspector/inspector-panel").InspectorPanel);
|
|
loader.lazyGetter(this, "WebConsolePanel", () => require("devtools/client/webconsole/panel").WebConsolePanel);
|
|
loader.lazyGetter(this, "DebuggerPanel", () => require("devtools/client/debugger/panel").DebuggerPanel);
|
|
loader.lazyGetter(this, "StyleEditorPanel", () => require("devtools/client/styleeditor/styleeditor-panel").StyleEditorPanel);
|
|
loader.lazyGetter(this, "ShaderEditorPanel", () => require("devtools/client/shadereditor/panel").ShaderEditorPanel);
|
|
loader.lazyGetter(this, "CanvasDebuggerPanel", () => require("devtools/client/canvasdebugger/panel").CanvasDebuggerPanel);
|
|
loader.lazyGetter(this, "WebAudioEditorPanel", () => require("devtools/client/webaudioeditor/panel").WebAudioEditorPanel);
|
|
loader.lazyGetter(this, "MemoryPanel", () => require("devtools/client/memory/panel").MemoryPanel);
|
|
loader.lazyGetter(this, "PerformancePanel", () => require("devtools/client/performance/panel").PerformancePanel);
|
|
loader.lazyGetter(this, "NetMonitorPanel", () => require("devtools/client/netmonitor/panel").NetMonitorPanel);
|
|
loader.lazyGetter(this, "StoragePanel", () => require("devtools/client/storage/panel").StoragePanel);
|
|
loader.lazyGetter(this, "ScratchpadPanel", () => require("devtools/client/scratchpad/scratchpad-panel").ScratchpadPanel);
|
|
|
|
// Strings
|
|
const toolboxProps = "chrome://devtools/locale/toolbox.properties";
|
|
const inspectorProps = "chrome://devtools/locale/inspector.properties";
|
|
const webConsoleProps = "chrome://devtools/locale/webconsole.properties";
|
|
const debuggerProps = "chrome://devtools/locale/debugger.properties";
|
|
const styleEditorProps = "chrome://devtools/locale/styleeditor.properties";
|
|
const shaderEditorProps = "chrome://devtools/locale/shadereditor.properties";
|
|
const canvasDebuggerProps = "chrome://devtools/locale/canvasdebugger.properties";
|
|
const webAudioEditorProps = "chrome://devtools/locale/webaudioeditor.properties";
|
|
const performanceProps = "chrome://devtools/locale/performance.properties";
|
|
const netMonitorProps = "chrome://devtools/locale/netmonitor.properties";
|
|
const storageProps = "chrome://devtools/locale/storage.properties";
|
|
const scratchpadProps = "chrome://devtools/locale/scratchpad.properties";
|
|
const memoryProps = "chrome://devtools/locale/memory.properties";
|
|
|
|
loader.lazyGetter(this, "toolboxStrings", () => Services.strings.createBundle(toolboxProps));
|
|
loader.lazyGetter(this, "performanceStrings", () => Services.strings.createBundle(performanceProps));
|
|
loader.lazyGetter(this, "webConsoleStrings", () => Services.strings.createBundle(webConsoleProps));
|
|
loader.lazyGetter(this, "debuggerStrings", () => Services.strings.createBundle(debuggerProps));
|
|
loader.lazyGetter(this, "styleEditorStrings", () => Services.strings.createBundle(styleEditorProps));
|
|
loader.lazyGetter(this, "shaderEditorStrings", () => Services.strings.createBundle(shaderEditorProps));
|
|
loader.lazyGetter(this, "canvasDebuggerStrings", () => Services.strings.createBundle(canvasDebuggerProps));
|
|
loader.lazyGetter(this, "webAudioEditorStrings", () => Services.strings.createBundle(webAudioEditorProps));
|
|
loader.lazyGetter(this, "inspectorStrings", () => Services.strings.createBundle(inspectorProps));
|
|
loader.lazyGetter(this, "netMonitorStrings", () => Services.strings.createBundle(netMonitorProps));
|
|
loader.lazyGetter(this, "storageStrings", () => Services.strings.createBundle(storageProps));
|
|
loader.lazyGetter(this, "scratchpadStrings", () => Services.strings.createBundle(scratchpadProps));
|
|
loader.lazyGetter(this, "memoryStrings", () => Services.strings.createBundle(memoryProps));
|
|
|
|
var Tools = {};
|
|
exports.Tools = Tools;
|
|
|
|
// Definitions
|
|
Tools.options = {
|
|
id: "options",
|
|
ordinal: 0,
|
|
url: "chrome://devtools/content/framework/toolbox-options.xhtml",
|
|
icon: "chrome://devtools/skin/images/tool-options.svg",
|
|
invertIconForLightTheme: true,
|
|
bgTheme: "theme-body",
|
|
label: l10n("options.label", toolboxStrings),
|
|
iconOnly: true,
|
|
panelLabel: l10n("options.panelLabel", toolboxStrings),
|
|
tooltip: l10n("optionsButton.tooltip", toolboxStrings),
|
|
inMenu: false,
|
|
|
|
isTargetSupported: function() {
|
|
return true;
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new OptionsPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.inspector = {
|
|
id: "inspector",
|
|
accesskey: l10n("inspector.accesskey", inspectorStrings),
|
|
key: l10n("inspector.commandkey", inspectorStrings),
|
|
ordinal: 1,
|
|
modifiers: osString == "Darwin" ? "accel,alt" : "accel,shift",
|
|
icon: "chrome://devtools/skin/images/tool-inspector.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/inspector/inspector.xul",
|
|
label: l10n("inspector.label", inspectorStrings),
|
|
panelLabel: l10n("inspector.panelLabel", inspectorStrings),
|
|
get tooltip() {
|
|
return l10n("inspector.tooltip2", inspectorStrings,
|
|
(osString == "Darwin" ? "Cmd+Opt+" : "Ctrl+Shift+") + this.key);
|
|
},
|
|
inMenu: true,
|
|
commands: [
|
|
"devtools/client/responsivedesign/resize-commands",
|
|
"devtools/client/inspector/inspector-commands",
|
|
"devtools/client/eyedropper/commands.js"
|
|
],
|
|
|
|
preventClosingOnKey: true,
|
|
onkey: function(panel, toolbox) {
|
|
toolbox.highlighterUtils.togglePicker();
|
|
},
|
|
|
|
isTargetSupported: function(target) {
|
|
return target.hasActor("inspector");
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new InspectorPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.webConsole = {
|
|
id: "webconsole",
|
|
key: l10n("cmd.commandkey", webConsoleStrings),
|
|
accesskey: l10n("webConsoleCmd.accesskey", webConsoleStrings),
|
|
modifiers: Services.appinfo.OS == "Darwin" ? "accel,alt" : "accel,shift",
|
|
ordinal: 2,
|
|
icon: "chrome://devtools/skin/images/tool-webconsole.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/webconsole/webconsole.xul",
|
|
label: l10n("ToolboxTabWebconsole.label", webConsoleStrings),
|
|
menuLabel: l10n("MenuWebconsole.label", webConsoleStrings),
|
|
panelLabel: l10n("ToolboxWebConsole.panelLabel", webConsoleStrings),
|
|
get tooltip() {
|
|
return l10n("ToolboxWebconsole.tooltip2", webConsoleStrings,
|
|
(osString == "Darwin" ? "Cmd+Opt+" : "Ctrl+Shift+") + this.key);
|
|
},
|
|
inMenu: true,
|
|
commands: "devtools/client/webconsole/console-commands",
|
|
|
|
preventClosingOnKey: true,
|
|
onkey: function(panel, toolbox) {
|
|
if (toolbox.splitConsole) {
|
|
return toolbox.focusConsoleInput();
|
|
}
|
|
|
|
panel.focusInput();
|
|
return undefined;
|
|
},
|
|
|
|
isTargetSupported: function() {
|
|
return true;
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new WebConsolePanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.jsdebugger = {
|
|
id: "jsdebugger",
|
|
key: l10n("debuggerMenu.commandkey", debuggerStrings),
|
|
accesskey: l10n("debuggerMenu.accesskey", debuggerStrings),
|
|
modifiers: osString == "Darwin" ? "accel,alt" : "accel,shift",
|
|
ordinal: 3,
|
|
icon: "chrome://devtools/skin/images/tool-debugger.svg",
|
|
invertIconForLightTheme: true,
|
|
highlightedicon: "chrome://devtools/skin/images/tool-debugger-paused.svg",
|
|
url: "chrome://devtools/content/debugger/debugger.xul",
|
|
label: l10n("ToolboxDebugger.label", debuggerStrings),
|
|
panelLabel: l10n("ToolboxDebugger.panelLabel", debuggerStrings),
|
|
get tooltip() {
|
|
return l10n("ToolboxDebugger.tooltip2", debuggerStrings,
|
|
(osString == "Darwin" ? "Cmd+Opt+" : "Ctrl+Shift+") + this.key);
|
|
},
|
|
inMenu: true,
|
|
commands: "devtools/client/debugger/debugger-commands",
|
|
|
|
isTargetSupported: function() {
|
|
return true;
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new DebuggerPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.styleEditor = {
|
|
id: "styleeditor",
|
|
key: l10n("open.commandkey", styleEditorStrings),
|
|
ordinal: 4,
|
|
accesskey: l10n("open.accesskey", styleEditorStrings),
|
|
modifiers: "shift",
|
|
icon: "chrome://devtools/skin/images/tool-styleeditor.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/styleeditor/styleeditor.xul",
|
|
label: l10n("ToolboxStyleEditor.label", styleEditorStrings),
|
|
panelLabel: l10n("ToolboxStyleEditor.panelLabel", styleEditorStrings),
|
|
get tooltip() {
|
|
return l10n("ToolboxStyleEditor.tooltip3", styleEditorStrings,
|
|
"Shift+" + functionkey(this.key));
|
|
},
|
|
inMenu: true,
|
|
commands: "devtools/client/styleeditor/styleeditor-commands",
|
|
|
|
isTargetSupported: function(target) {
|
|
return target.hasActor("styleEditor") || target.hasActor("styleSheets");
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new StyleEditorPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.shaderEditor = {
|
|
id: "shadereditor",
|
|
ordinal: 5,
|
|
visibilityswitch: "devtools.shadereditor.enabled",
|
|
icon: "chrome://devtools/skin/images/tool-shadereditor.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/shadereditor/shadereditor.xul",
|
|
label: l10n("ToolboxShaderEditor.label", shaderEditorStrings),
|
|
panelLabel: l10n("ToolboxShaderEditor.panelLabel", shaderEditorStrings),
|
|
tooltip: l10n("ToolboxShaderEditor.tooltip", shaderEditorStrings),
|
|
|
|
isTargetSupported: function(target) {
|
|
return target.hasActor("webgl") && !target.chrome;
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new ShaderEditorPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.canvasDebugger = {
|
|
id: "canvasdebugger",
|
|
ordinal: 6,
|
|
visibilityswitch: "devtools.canvasdebugger.enabled",
|
|
icon: "chrome://devtools/skin/images/tool-canvas.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/canvasdebugger/canvasdebugger.xul",
|
|
label: l10n("ToolboxCanvasDebugger.label", canvasDebuggerStrings),
|
|
panelLabel: l10n("ToolboxCanvasDebugger.panelLabel", canvasDebuggerStrings),
|
|
tooltip: l10n("ToolboxCanvasDebugger.tooltip", canvasDebuggerStrings),
|
|
|
|
// Hide the Canvas Debugger in the Add-on Debugger and Browser Toolbox
|
|
// (bug 1047520).
|
|
isTargetSupported: function(target) {
|
|
return target.hasActor("canvas") && !target.chrome;
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new CanvasDebuggerPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.performance = {
|
|
id: "performance",
|
|
ordinal: 7,
|
|
icon: "chrome://devtools/skin/images/tool-profiler.svg",
|
|
invertIconForLightTheme: true,
|
|
highlightedicon: "chrome://devtools/skin/images/tool-profiler-active.svg",
|
|
url: "chrome://devtools/content/performance/performance.xul",
|
|
visibilityswitch: "devtools.performance.enabled",
|
|
label: l10n("performance.label", performanceStrings),
|
|
panelLabel: l10n("performance.panelLabel", performanceStrings),
|
|
get tooltip() {
|
|
return l10n("performance.tooltip", performanceStrings,
|
|
"Shift+" + functionkey(this.key));
|
|
},
|
|
accesskey: l10n("performance.accesskey", performanceStrings),
|
|
key: l10n("performance.commandkey", performanceStrings),
|
|
modifiers: "shift",
|
|
inMenu: true,
|
|
|
|
isTargetSupported: function(target) {
|
|
return target.hasActor("profiler");
|
|
},
|
|
|
|
build: function(frame, target) {
|
|
return new PerformancePanel(frame, target);
|
|
}
|
|
};
|
|
|
|
Tools.memory = {
|
|
id: "memory",
|
|
ordinal: 8,
|
|
icon: "chrome://devtools/skin/images/tool-memory.svg",
|
|
invertIconForLightTheme: true,
|
|
highlightedicon: "chrome://devtools/skin/images/tool-memory-active.svg",
|
|
url: "chrome://devtools/content/memory/memory.xhtml",
|
|
visibilityswitch: "devtools.memory.enabled",
|
|
label: l10n("memory.label", memoryStrings),
|
|
panelLabel: l10n("memory.panelLabel", memoryStrings),
|
|
tooltip: l10n("memory.tooltip", memoryStrings),
|
|
|
|
isTargetSupported: function(target) {
|
|
return target.getTrait("heapSnapshots");
|
|
},
|
|
|
|
build: function(frame, target) {
|
|
return new MemoryPanel(frame, target);
|
|
}
|
|
};
|
|
|
|
Tools.netMonitor = {
|
|
id: "netmonitor",
|
|
accesskey: l10n("netmonitor.accesskey", netMonitorStrings),
|
|
key: l10n("netmonitor.commandkey", netMonitorStrings),
|
|
ordinal: 9,
|
|
modifiers: osString == "Darwin" ? "accel,alt" : "accel,shift",
|
|
visibilityswitch: "devtools.netmonitor.enabled",
|
|
icon: "chrome://devtools/skin/images/tool-network.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/netmonitor/netmonitor.xul",
|
|
label: l10n("netmonitor.label", netMonitorStrings),
|
|
panelLabel: l10n("netmonitor.panelLabel", netMonitorStrings),
|
|
get tooltip() {
|
|
return l10n("netmonitor.tooltip2", netMonitorStrings,
|
|
(osString == "Darwin" ? "Cmd+Opt+" : "Ctrl+Shift+") + this.key);
|
|
},
|
|
inMenu: true,
|
|
|
|
isTargetSupported: function(target) {
|
|
return target.getTrait("networkMonitor");
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new NetMonitorPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.storage = {
|
|
id: "storage",
|
|
key: l10n("storage.commandkey", storageStrings),
|
|
ordinal: 10,
|
|
accesskey: l10n("storage.accesskey", storageStrings),
|
|
modifiers: "shift",
|
|
visibilityswitch: "devtools.storage.enabled",
|
|
icon: "chrome://devtools/skin/images/tool-storage.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/storage/storage.xul",
|
|
label: l10n("storage.label", storageStrings),
|
|
menuLabel: l10n("storage.menuLabel", storageStrings),
|
|
panelLabel: l10n("storage.panelLabel", storageStrings),
|
|
get tooltip() {
|
|
return l10n("storage.tooltip3", storageStrings,
|
|
"Shift+" + functionkey(this.key));
|
|
},
|
|
inMenu: true,
|
|
|
|
isTargetSupported: function(target) {
|
|
return target.isLocalTab ||
|
|
(target.hasActor("storage") && target.getTrait("storageInspector"));
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new StoragePanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.webAudioEditor = {
|
|
id: "webaudioeditor",
|
|
ordinal: 11,
|
|
visibilityswitch: "devtools.webaudioeditor.enabled",
|
|
icon: "chrome://devtools/skin/images/tool-webaudio.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/webaudioeditor/webaudioeditor.xul",
|
|
label: l10n("ToolboxWebAudioEditor1.label", webAudioEditorStrings),
|
|
panelLabel: l10n("ToolboxWebAudioEditor1.panelLabel", webAudioEditorStrings),
|
|
tooltip: l10n("ToolboxWebAudioEditor1.tooltip", webAudioEditorStrings),
|
|
|
|
isTargetSupported: function(target) {
|
|
return !target.chrome && target.hasActor("webaudio");
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new WebAudioEditorPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
Tools.scratchpad = {
|
|
id: "scratchpad",
|
|
ordinal: 12,
|
|
visibilityswitch: "devtools.scratchpad.enabled",
|
|
icon: "chrome://devtools/skin/images/tool-scratchpad.svg",
|
|
invertIconForLightTheme: true,
|
|
url: "chrome://devtools/content/scratchpad/scratchpad.xul",
|
|
label: l10n("scratchpad.label", scratchpadStrings),
|
|
panelLabel: l10n("scratchpad.panelLabel", scratchpadStrings),
|
|
tooltip: l10n("scratchpad.tooltip", scratchpadStrings),
|
|
inMenu: false,
|
|
commands: "devtools/client/scratchpad/scratchpad-commands",
|
|
|
|
isTargetSupported: function(target) {
|
|
return target.hasActor("console");
|
|
},
|
|
|
|
build: function(iframeWindow, toolbox) {
|
|
return new ScratchpadPanel(iframeWindow, toolbox);
|
|
}
|
|
};
|
|
|
|
var defaultTools = [
|
|
Tools.options,
|
|
Tools.webConsole,
|
|
Tools.inspector,
|
|
Tools.jsdebugger,
|
|
Tools.styleEditor,
|
|
Tools.shaderEditor,
|
|
Tools.canvasDebugger,
|
|
Tools.webAudioEditor,
|
|
Tools.performance,
|
|
Tools.netMonitor,
|
|
Tools.storage,
|
|
Tools.scratchpad,
|
|
Tools.memory,
|
|
];
|
|
|
|
exports.defaultTools = defaultTools;
|
|
|
|
Tools.darkTheme = {
|
|
id: "dark",
|
|
label: l10n("options.darkTheme.label", toolboxStrings),
|
|
ordinal: 1,
|
|
stylesheets: ["chrome://devtools/skin/dark-theme.css"],
|
|
classList: ["theme-dark"],
|
|
};
|
|
|
|
Tools.lightTheme = {
|
|
id: "light",
|
|
label: l10n("options.lightTheme.label", toolboxStrings),
|
|
ordinal: 2,
|
|
stylesheets: ["chrome://devtools/skin/light-theme.css"],
|
|
classList: ["theme-light"],
|
|
};
|
|
|
|
Tools.firebugTheme = {
|
|
id: "firebug",
|
|
label: l10n("options.firebugTheme.label", toolboxStrings),
|
|
ordinal: 3,
|
|
stylesheets: ["chrome://devtools/skin/firebug-theme.css"],
|
|
classList: ["theme-light", "theme-firebug"],
|
|
};
|
|
|
|
exports.defaultThemes = [
|
|
Tools.darkTheme,
|
|
Tools.lightTheme,
|
|
Tools.firebugTheme,
|
|
];
|
|
|
|
/**
|
|
* Lookup l10n string from a string bundle.
|
|
*
|
|
* @param {string} name
|
|
* The key to lookup.
|
|
* @param {StringBundle} bundle
|
|
* The key to lookup.
|
|
* @returns A localized version of the given key.
|
|
*/
|
|
function l10n(name, bundle, arg) {
|
|
try {
|
|
return arg ? bundle.formatStringFromName(name, [arg], 1)
|
|
: bundle.GetStringFromName(name);
|
|
} catch (ex) {
|
|
Services.console.logStringMessage("Error reading '" + name + "'");
|
|
throw new Error("l10n error with " + name);
|
|
}
|
|
}
|
|
|
|
function functionkey(shortkey) {
|
|
return shortkey.split("_")[1];
|
|
}
|