diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js index 23c572dc886e..4f8f35acd24a 100644 --- a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js @@ -45,9 +45,11 @@ add_task(async function testWebExtensionsToolboxNoBackgroundPage() { ); const toolbox = getToolbox(devtoolsWindow); + ok( + toolbox.commands.descriptorFront.isWebExtensionDescriptor, + "Toolbox is debugging an addon" + ); const targetName = toolbox.target.name; - const isAddonTarget = toolbox.target.isAddon; - ok(isAddonTarget, "Toolbox target is an addon"); is(targetName, ADDON_NOBG_NAME, "Toolbox has the expected target"); const inspector = await toolbox.selectTool("inspector"); diff --git a/devtools/client/definitions.js b/devtools/client/definitions.js index 955f97630317..361882c41303 100644 --- a/devtools/client/definitions.js +++ b/devtools/client/definitions.js @@ -300,7 +300,11 @@ Tools.memory = { tooltip: l10n("memory.tooltip"), isToolSupported(toolbox) { - return !toolbox.target.isAddon && !toolbox.target.isWorkerTarget; + const { descriptorFront } = toolbox.commands; + return ( + !descriptorFront.isWebExtensionDescriptor && + !descriptorFront.isWorkerDescriptor + ); }, build(frame, toolbox, commands) { diff --git a/devtools/client/fronts/targets/target-mixin.js b/devtools/client/fronts/targets/target-mixin.js index 21bf548a02c2..7acb00e7eab3 100644 --- a/devtools/client/fronts/targets/target-mixin.js +++ b/devtools/client/fronts/targets/target-mixin.js @@ -281,7 +281,9 @@ function TargetMixin(parentClass) { // Allows to controls which features are available against // a chrome or a content document. get chrome() { - return this.isAddon || this.isContentProcess || this.isParentProcess; + return ( + this.isWebExtension || this.isContentProcess || this.isParentProcess + ); } // Tells us if the related actor implements WindowGlobalTargetActor @@ -292,7 +294,7 @@ function TargetMixin(parentClass) { } get name() { - if (this.isAddon || this.isContentProcess) { + if (this.isWebExtension || this.isContentProcess) { return this.targetForm.name; } return this.title; @@ -306,10 +308,6 @@ function TargetMixin(parentClass) { return this._url; } - get isAddon() { - return this.isWebExtension; - } - get isWorkerTarget() { // XXX Remove the check on `workerDescriptor` as part of Bug 1667404. return (