зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1764505 - [devtools] Migrate Tool's definition isTargetSupport to isToolSupported. r=nchevobbe
And pass a toolbox instead of only the toplevel target. It helps identify the browser toolbox and easily enable/disable tools for it. Differential Revision: https://phabricator.services.mozilla.com/D143628
This commit is contained in:
Родитель
ee2dcf8fe6
Коммит
ee871dd92b
|
@ -156,7 +156,7 @@ class ParentDevToolsPanel extends BaseDevToolsPanel {
|
|||
// panelLabel is used to set the aria-label attribute (See Bug 1570645).
|
||||
panelLabel: title,
|
||||
tooltip: `DevTools Panel added by "${extensionName}" add-on.`,
|
||||
isTargetSupported: target => target.isLocalTab,
|
||||
isToolSupported: toolbox => toolbox.target.isLocalTab,
|
||||
build: (window, toolbox) => {
|
||||
if (toolbox !== this.toolbox) {
|
||||
throw new Error(
|
||||
|
|
|
@ -37,7 +37,7 @@ async function registerBlankToolboxPanel() {
|
|||
id: TOOLBOX_BLANK_PANEL_ID,
|
||||
url: "about:blank",
|
||||
label: "Blank Tool",
|
||||
isTargetSupported() {
|
||||
isToolSupported() {
|
||||
return true;
|
||||
},
|
||||
build(iframeWindow, toolbox) {
|
||||
|
|
|
@ -124,7 +124,7 @@ Tools.options = {
|
|||
tooltip: l10n("optionsButton.tooltip"),
|
||||
inMenu: false,
|
||||
|
||||
isTargetSupported: function() {
|
||||
isToolSupported: function() {
|
||||
return true;
|
||||
},
|
||||
|
||||
|
@ -162,8 +162,8 @@ Tools.inspector = {
|
|||
toolbox.nodePicker.togglePicker();
|
||||
},
|
||||
|
||||
isTargetSupported: function(target) {
|
||||
return target.hasActor("inspector");
|
||||
isToolSupported: function(toolbox) {
|
||||
return toolbox.target.hasActor("inspector");
|
||||
},
|
||||
|
||||
build: function(iframeWindow, toolbox, commands) {
|
||||
|
@ -198,7 +198,7 @@ Tools.webConsole = {
|
|||
return undefined;
|
||||
},
|
||||
|
||||
isTargetSupported: function() {
|
||||
isToolSupported: function() {
|
||||
return true;
|
||||
},
|
||||
build: function(iframeWindow, toolbox, commands) {
|
||||
|
@ -222,7 +222,7 @@ Tools.jsdebugger = {
|
|||
);
|
||||
},
|
||||
inMenu: false,
|
||||
isTargetSupported: function() {
|
||||
isToolSupported: function() {
|
||||
return true;
|
||||
},
|
||||
build: function(iframeWindow, toolbox, commands) {
|
||||
|
@ -246,8 +246,8 @@ Tools.styleEditor = {
|
|||
);
|
||||
},
|
||||
inMenu: false,
|
||||
isTargetSupported: function(target) {
|
||||
return target.hasActor("styleSheets");
|
||||
isToolSupported: function(toolbox) {
|
||||
return toolbox.target.hasActor("styleSheets");
|
||||
},
|
||||
|
||||
build: function(iframeWindow, toolbox, commands) {
|
||||
|
@ -281,21 +281,21 @@ function switchPerformancePanel() {
|
|||
Tools.performance.build = function(frame, toolbox, commands) {
|
||||
return new NewPerformancePanel(frame, toolbox, commands);
|
||||
};
|
||||
Tools.performance.isTargetSupported = function(target) {
|
||||
Tools.performance.isToolSupported = function(toolbox) {
|
||||
// Only use the new performance panel on local tab toolboxes, as they are guaranteed
|
||||
// to have a performance actor.
|
||||
// Remote tab toolboxes (eg about:devtools-toolbox from about:debugging) should not
|
||||
// use the performance panel; about:debugging provides a "Profile performance" button
|
||||
// which can be used instead, without having the overhead of starting a remote toolbox.
|
||||
return target.isLocalTab;
|
||||
return toolbox.target.isLocalTab;
|
||||
};
|
||||
} else {
|
||||
Tools.performance.url = "chrome://devtools/content/performance/index.xhtml";
|
||||
Tools.performance.build = function(frame, toolbox, commands) {
|
||||
return new PerformancePanel(frame, toolbox, commands);
|
||||
};
|
||||
Tools.performance.isTargetSupported = function(target) {
|
||||
return target.hasActor("performance");
|
||||
Tools.performance.isToolSupported = function(toolbox) {
|
||||
return toolbox.target.hasActor("performance");
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -327,8 +327,8 @@ Tools.memory = {
|
|||
panelLabel: l10n("memory.panelLabel"),
|
||||
tooltip: l10n("memory.tooltip"),
|
||||
|
||||
isTargetSupported: function(target) {
|
||||
return !target.isAddon && !target.isWorkerTarget;
|
||||
isToolSupported: function(toolbox) {
|
||||
return !toolbox.target.isAddon && !toolbox.target.isWorkerTarget;
|
||||
},
|
||||
|
||||
build: function(frame, toolbox, commands) {
|
||||
|
@ -354,8 +354,11 @@ Tools.netMonitor = {
|
|||
},
|
||||
inMenu: false,
|
||||
|
||||
isTargetSupported: function(target) {
|
||||
return target.getTrait("networkMonitor") && !target.isWorkerTarget;
|
||||
isToolSupported: function(toolbox) {
|
||||
return (
|
||||
toolbox.target.getTrait("networkMonitor") &&
|
||||
!toolbox.target.isWorkerTarget
|
||||
);
|
||||
},
|
||||
|
||||
build: function(iframeWindow, toolbox, commands) {
|
||||
|
@ -381,8 +384,8 @@ Tools.storage = {
|
|||
},
|
||||
inMenu: false,
|
||||
|
||||
isTargetSupported: function(target) {
|
||||
return target.hasActor("storage");
|
||||
isToolSupported: function(toolbox) {
|
||||
return toolbox.target.hasActor("storage");
|
||||
},
|
||||
|
||||
build: function(iframeWindow, toolbox, commands) {
|
||||
|
@ -408,7 +411,7 @@ Tools.dom = {
|
|||
},
|
||||
inMenu: false,
|
||||
|
||||
isTargetSupported: function(target) {
|
||||
isToolSupported: function() {
|
||||
return true;
|
||||
},
|
||||
|
||||
|
@ -436,8 +439,8 @@ Tools.accessibility = {
|
|||
},
|
||||
inMenu: false,
|
||||
|
||||
isTargetSupported(target) {
|
||||
return target.hasActor("accessibility");
|
||||
isToolSupported(toolbox) {
|
||||
return toolbox.target.hasActor("accessibility");
|
||||
},
|
||||
|
||||
build(iframeWindow, toolbox, commands) {
|
||||
|
@ -456,8 +459,8 @@ Tools.application = {
|
|||
tooltip: l10n("application.tooltip"),
|
||||
inMenu: false,
|
||||
|
||||
isTargetSupported: function(target) {
|
||||
return target.hasActor("manifest");
|
||||
isToolSupported: function(toolbox) {
|
||||
return toolbox.target.hasActor("manifest");
|
||||
},
|
||||
|
||||
build: function(iframeWindow, toolbox, commands) {
|
||||
|
@ -507,7 +510,7 @@ exports.ToolboxButtons = [
|
|||
{
|
||||
id: "command-button-experimental-prefs",
|
||||
description: "DevTools Experimental preferences",
|
||||
isTargetSupported: target => !AppConstants.MOZILLA_OFFICIAL,
|
||||
isToolSupported: () => !AppConstants.MOZILLA_OFFICIAL,
|
||||
onClick: (event, toolbox) => DevToolsExperimentalPrefs.showTooltip(toolbox),
|
||||
isChecked: () => DevToolsExperimentalPrefs.isAnyPreferenceEnabled(),
|
||||
},
|
||||
|
@ -517,7 +520,7 @@ exports.ToolboxButtons = [
|
|||
"toolbox.buttons.responsive",
|
||||
osString == "Darwin" ? "Cmd+Opt+M" : "Ctrl+Shift+M"
|
||||
),
|
||||
isTargetSupported: target => target.isLocalTab,
|
||||
isToolSupported: toolbox => toolbox.target.isLocalTab,
|
||||
onClick(event, toolbox) {
|
||||
const { localTab } = toolbox.descriptorFront;
|
||||
const browserWindow = localTab.ownerDocument.defaultView;
|
||||
|
@ -544,12 +547,12 @@ exports.ToolboxButtons = [
|
|||
{
|
||||
id: "command-button-screenshot",
|
||||
description: l10n("toolbox.buttons.screenshot"),
|
||||
isTargetSupported: targetFront => {
|
||||
isToolSupported: toolbox => {
|
||||
return (
|
||||
// @backward-compat { version 87 } We need to check for the screenshot actor as well
|
||||
// when connecting to older server that does not have the screenshotContentActor
|
||||
targetFront.hasActor("screenshotContent") ||
|
||||
targetFront.hasActor("screenshot")
|
||||
toolbox.target.hasActor("screenshotContent") ||
|
||||
toolbox.target.hasActor("screenshot")
|
||||
);
|
||||
},
|
||||
async onClick(event, toolbox) {
|
||||
|
@ -605,7 +608,7 @@ function createHighlightButton(highlighterName, id) {
|
|||
return {
|
||||
id: `command-button-${id}`,
|
||||
description: l10n(`toolbox.buttons.${id}`),
|
||||
isTargetSupported: target => !target.chrome,
|
||||
isToolSupported: toolbox => !toolbox.target.chrome,
|
||||
async onClick(event, toolbox) {
|
||||
const inspectorFront = await toolbox.target.getFront("inspector");
|
||||
const highlighter = await inspectorFront.getOrCreateHighlighterByType(
|
||||
|
|
|
@ -11,7 +11,7 @@ async function runTests(aTab) {
|
|||
const toolDefinition = {
|
||||
id: "testTool",
|
||||
visibilityswitch: "devtools.testTool.enabled",
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
url: "about:blank",
|
||||
label: "someLabel",
|
||||
build: function(iframeWindow, toolbox) {
|
||||
|
|
|
@ -20,7 +20,7 @@ function testRegister(aToolbox) {
|
|||
id: "testTool",
|
||||
label: "Test Tool",
|
||||
inMenu: true,
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
build: function() {},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ add_task(async function() {
|
|||
function registerNewTool() {
|
||||
const toolDefinition = {
|
||||
id: "testTool",
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
visibilityswitch: "devtools.test-tool.enabled",
|
||||
url: "about:blank",
|
||||
label: "someLabel",
|
||||
|
@ -81,7 +81,7 @@ function registerNewWebExtensions() {
|
|||
function registerNewPerToolboxTool() {
|
||||
const toolDefinition = {
|
||||
id: "test-pertoolbox-tool",
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
visibilityswitch: "devtools.test-pertoolbox-tool.enabled",
|
||||
url: "about:blank",
|
||||
label: "perToolboxSomeLabel",
|
||||
|
|
|
@ -50,9 +50,8 @@ async function testToggleToolboxButtons(toolbox, optionsPanelWin) {
|
|||
|
||||
// Filter out all the buttons which are not supported on the current target.
|
||||
// (DevTools Experimental Preferences etc...)
|
||||
const target = toolbox.target;
|
||||
const toolbarButtons = toolbox.toolbarButtons.filter(tool =>
|
||||
tool.isTargetSupported(target)
|
||||
tool.isToolSupported(toolbox)
|
||||
);
|
||||
|
||||
const visibleToolbarButtons = toolbarButtons.filter(tool => tool.isVisible);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
const testToolDefinition = {
|
||||
id: "testTool",
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
visibilityswitch: "devtools.test-tool.enabled",
|
||||
url: "about:blank",
|
||||
label: "someLabel",
|
||||
|
@ -34,7 +34,7 @@ add_task(async function() {
|
|||
await toolbox.destroy();
|
||||
|
||||
// Make the previously selected tool unavailable.
|
||||
testToolDefinition.isTargetSupported = () => false;
|
||||
testToolDefinition.isToolSupported = () => false;
|
||||
|
||||
toolbox = await gDevTools.showToolboxForTab(tab);
|
||||
is(toolbox.currentToolId, "webconsole", "web console was selected");
|
||||
|
|
|
@ -40,7 +40,7 @@ add_task(async function automaticallyBindTexbox() {
|
|||
|
||||
gDevTools.registerTool({
|
||||
id: lazyToolId,
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
url: CHROME_URL_ROOT + "doc_lazy_tool.html",
|
||||
label: "Lazy",
|
||||
build: function(iframeWindow, toolbox) {
|
||||
|
|
|
@ -68,7 +68,7 @@ add_task(async function automaticallyBindTexbox() {
|
|||
);
|
||||
gDevTools.registerTool({
|
||||
id: textboxToolId,
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
url: CHROME_URL_ROOT + "doc_textbox_tool.html",
|
||||
label: "Context menu works without tool intervention",
|
||||
build: function(iframeWindow, toolbox) {
|
||||
|
|
|
@ -69,7 +69,7 @@ add_task(async function() {
|
|||
id: "test-tools",
|
||||
label: "Test Tools",
|
||||
isMenu: true,
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
build: function() {},
|
||||
});
|
||||
await onRegistered;
|
||||
|
|
|
@ -48,7 +48,7 @@ function toolboxRegister(aToolbox) {
|
|||
// See ok(tab, ...) assert below and Bug 1596345.
|
||||
label: "Test Tool",
|
||||
inMenu: true,
|
||||
isTargetSupported: () => true,
|
||||
isToolSupported: () => true,
|
||||
build: function() {
|
||||
info("per-toolbox tool has been built.");
|
||||
resolveToolInstanceBuild();
|
||||
|
|
|
@ -37,7 +37,7 @@ async function getSupportedToolIds(tab) {
|
|||
|
||||
const toolIds = gDevTools
|
||||
.getToolDefinitionArray()
|
||||
.filter(def => def.isTargetSupported(toolbox.target))
|
||||
.filter(def => def.isToolSupported(toolbox))
|
||||
.map(def => def.id);
|
||||
|
||||
if (shouldDestroyToolbox) {
|
||||
|
|
|
@ -210,7 +210,7 @@ OptionsPanel.prototype = {
|
|||
};
|
||||
|
||||
for (const button of toolbarButtons) {
|
||||
if (!button.isTargetSupported(this.toolbox.target)) {
|
||||
if (!button.isToolSupported(this.toolbox)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ OptionsPanel.prototype = {
|
|||
checkboxInput.setAttribute("title", tool.tooltip || "");
|
||||
|
||||
const checkboxSpanLabel = this.panelDoc.createElement("span");
|
||||
if (tool.isTargetSupported(this.target)) {
|
||||
if (tool.isToolSupported(this.toolbox)) {
|
||||
checkboxSpanLabel.textContent = tool.label;
|
||||
} else {
|
||||
atleastOneToolNotSupported = true;
|
||||
|
@ -357,7 +357,7 @@ OptionsPanel.prototype = {
|
|||
visibilityswitch: pref,
|
||||
|
||||
// Only local tabs are currently supported as targets.
|
||||
isTargetSupported: target => target.isLocalTab,
|
||||
isToolSupported: toolbox => toolbox.target.isLocalTab,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
@ -957,11 +957,11 @@ Toolbox.prototype = {
|
|||
|
||||
this._pingTelemetry();
|
||||
|
||||
// The isTargetSupported check needs to happen after the target is
|
||||
// The isToolSupported check needs to happen after the target is
|
||||
// remoted, otherwise we could have done it in the toolbox constructor
|
||||
// (bug 1072764).
|
||||
const toolDef = gDevTools.getToolDefinition(this._defaultToolId);
|
||||
if (!toolDef || !toolDef.isTargetSupported(this.target)) {
|
||||
if (!toolDef || !toolDef.isToolSupported(this)) {
|
||||
this._defaultToolId = "webconsole";
|
||||
}
|
||||
|
||||
|
@ -1577,8 +1577,8 @@ Toolbox.prototype = {
|
|||
* unregister listeners set when `setup` was called and avoid
|
||||
* memory leaks. The same arguments than `setup` function are
|
||||
* passed to `teardown`.
|
||||
* @property {Function} isTargetSupported - Function to automatically enable/disable
|
||||
* the button based on the target. If the target don't support
|
||||
* @property {Function} isToolSupported - Function to automatically enable/disable
|
||||
* the button based on the toolbox. If the toolbox don't support
|
||||
* the button feature, this method should return false.
|
||||
* @property {Function} isCurrentlyVisible - Function to automatically
|
||||
* hide/show the button based on current state.
|
||||
|
@ -1597,7 +1597,7 @@ Toolbox.prototype = {
|
|||
isInStartContainer,
|
||||
setup,
|
||||
teardown,
|
||||
isTargetSupported,
|
||||
isToolSupported,
|
||||
isCurrentlyVisible,
|
||||
isChecked,
|
||||
onKeyDown,
|
||||
|
@ -1620,7 +1620,7 @@ Toolbox.prototype = {
|
|||
onKeyDown(event, toolbox);
|
||||
}
|
||||
},
|
||||
isTargetSupported,
|
||||
isToolSupported,
|
||||
isCurrentlyVisible,
|
||||
get isChecked() {
|
||||
if (typeof isChecked == "function") {
|
||||
|
@ -1854,7 +1854,7 @@ Toolbox.prototype = {
|
|||
// Get the definitions that will only affect the main tab area.
|
||||
this.panelDefinitions = definitions.filter(
|
||||
definition =>
|
||||
definition.isTargetSupported(this.target) && definition.id !== "options"
|
||||
definition.isToolSupported(this) && definition.id !== "options"
|
||||
);
|
||||
|
||||
// Do async lookups for the target browser's state.
|
||||
|
@ -1992,8 +1992,8 @@ Toolbox.prototype = {
|
|||
this.frameButton = this._createButtonState({
|
||||
id: "command-button-frames",
|
||||
description: L10N.getStr("toolbox.frames.tooltip"),
|
||||
isTargetSupported: target => {
|
||||
return target.getTrait("frames");
|
||||
isToolSupported: toolbox => {
|
||||
return toolbox.target.getTrait("frames");
|
||||
},
|
||||
isCurrentlyVisible: () => {
|
||||
const hasFrames = this.frameMap.size > 1;
|
||||
|
@ -2012,7 +2012,7 @@ Toolbox.prototype = {
|
|||
this.errorCountButton = this._createButtonState({
|
||||
id: "command-button-errorcount",
|
||||
isInStartContainer: false,
|
||||
isTargetSupported: target => true,
|
||||
isToolSupported: toolbox => true,
|
||||
description: L10N.getStr("toolbox.errorCountButton.description"),
|
||||
});
|
||||
// Use updateErrorCountButton to set some properties so we don't have to repeat
|
||||
|
@ -2140,8 +2140,8 @@ Toolbox.prototype = {
|
|||
description: this._getPickerTooltip(),
|
||||
onClick: this._onPickerClick,
|
||||
isInStartContainer: true,
|
||||
isTargetSupported: target => {
|
||||
return target.getTrait("frames");
|
||||
isToolSupported: toolbox => {
|
||||
return toolbox.target.getTrait("frames");
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -2305,7 +2305,7 @@ Toolbox.prototype = {
|
|||
|
||||
// We need to do something a bit different to avoid some test failures. This function
|
||||
// can be called from onWillNavigate, and the current target might have this `traits`
|
||||
// property nullifed, which is unfortunate as that's what isTargetSupported is checking,
|
||||
// property nullifed, which is unfortunate as that's what isToolSupported is checking,
|
||||
// so it will throw.
|
||||
// So here, we check first if the button isn't going to be visible anyway (it only checks
|
||||
// for this.frameMap size) so we don't call _commandIsVisible.
|
||||
|
@ -2330,13 +2330,13 @@ Toolbox.prototype = {
|
|||
* Ensure the visibility of each toolbox button matches the preference value.
|
||||
*/
|
||||
_commandIsVisible: function(button) {
|
||||
const { isTargetSupported, isCurrentlyVisible, visibilityswitch } = button;
|
||||
const { isToolSupported, isCurrentlyVisible, visibilityswitch } = button;
|
||||
|
||||
if (!Services.prefs.getBoolPref(visibilityswitch, true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isTargetSupported && !isTargetSupported(this.target)) {
|
||||
if (isToolSupported && !isToolSupported(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2354,7 +2354,7 @@ Toolbox.prototype = {
|
|||
* Tool definition of the tool to build a tab for.
|
||||
*/
|
||||
_buildPanelForTool: function(toolDefinition) {
|
||||
if (!toolDefinition.isTargetSupported(this.target)) {
|
||||
if (!toolDefinition.isToolSupported(this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3704,7 +3704,7 @@ Toolbox.prototype = {
|
|||
isAdditionalTool = true;
|
||||
}
|
||||
|
||||
if (definition.isTargetSupported(this.target)) {
|
||||
if (definition.isToolSupported(this)) {
|
||||
if (isAdditionalTool) {
|
||||
this.visibleAdditionalTools = [...this.visibleAdditionalTools, toolId];
|
||||
this._combineAndSortPanelDefinitions();
|
||||
|
|
|
@ -1549,8 +1549,7 @@ SelectorView.prototype = {
|
|||
}
|
||||
|
||||
const { sheet, line, column } = this.generatedLocation;
|
||||
const target = inspector.currentTarget;
|
||||
if (ToolDefinitions.styleEditor.isTargetSupported(target)) {
|
||||
if (ToolDefinitions.styleEditor.isToolSupported(inspector.toolbox)) {
|
||||
inspector.toolbox.viewSourceInStyleEditorByFront(sheet, line, column);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -302,8 +302,7 @@ RuleEditor.prototype = {
|
|||
}
|
||||
|
||||
const { inspector } = this.ruleView;
|
||||
const target = inspector.currentTarget;
|
||||
if (Tools.styleEditor.isTargetSupported(target)) {
|
||||
if (Tools.styleEditor.isToolSupported(inspector.toolbox)) {
|
||||
inspector.toolbox.viewSourceInStyleEditorByFront(
|
||||
this.rule.sheet,
|
||||
this.rule.ruleLine,
|
||||
|
|
|
@ -404,15 +404,15 @@ A ``ToolDefinition`` object contains all the required information for a tool to
|
|||
Methods
|
||||
~~~~~~~
|
||||
|
||||
``isTargetSupported(target)``
|
||||
A method that is called during toolbox construction to check if the tool supports debugging the given target.
|
||||
``isToolSupported(toolbox)``
|
||||
A method that is called during toolbox construction to check if the tool supports debugging the given target of the given toolbox.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
- ``target {Target}`` - The target to check.
|
||||
- ``toolbox {Toolbox}`` - The toolbox where the tool is going to be displayed, if supported.
|
||||
|
||||
**Return value:**
|
||||
A boolean indicating if the tool supports the given target.
|
||||
A boolean indicating if the tool supports the given toolbox's target.
|
||||
|
||||
``build(window, toolbox)``
|
||||
A method that builds the :ref:`ToolPanel <devtoolsapi-tool-panel>` for this tool.
|
||||
|
@ -508,7 +508,7 @@ Here's a minimal definition for a tool.
|
|||
label: "My Tool",
|
||||
icon: "chrome://browser/skin/devtools/tool-webconsole.svg",
|
||||
url: "about:blank",
|
||||
isTargetSupported: target => true,
|
||||
isToolSupported: toolbox => true,
|
||||
build: (window, toolbox) => new MyToolPanel(window, toolbox)
|
||||
};
|
||||
|
||||
|
@ -763,8 +763,8 @@ Register a tool
|
|||
return strings.GetStringFromName("inspector.label");
|
||||
},
|
||||
|
||||
isTargetSupported: function(target) {
|
||||
return !target.isRemote;
|
||||
isToolSupported: function(toolbox) {
|
||||
return toolbox.target.isLocalTab;
|
||||
},
|
||||
|
||||
build: function(iframeWindow, toolbox, node) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче