Bug 1474379 - Match regex against the entire panel ID. r=miker,rpl a=RyanVM
authorIan Moody <moz-ian@perix.co.uk>
Tue, 10 Jul 2018 17:38:35 +0100
changeset 473818 b5d39c025741
parent 473817 88d84c16e254
child 473819 24dd1a9e2c2c
push id1749
push userryanvm@gmail.com
push dateMon, 06 Aug 2018 13:40:05 +0000
treeherdermozilla-release@b5d39c025741 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker, rpl, RyanVM
bugs1474379
milestone61.0.2
Bug 1474379 - Match regex against the entire panel ID. r=miker,rpl a=RyanVM So panels provided by extensions with IDs that contain words like "inspector" don't break. Include test in existing panel creation test. MozReview-Commit-ID: JerMCaKRgkl
browser/components/extensions/test/browser/browser_ext_devtools_panel.js
devtools/client/framework/toolbox.js
--- a/browser/components/extensions/test/browser/browser_ext_devtools_panel.js
+++ b/browser/components/extensions/test/browser/browser_ext_devtools_panel.js
@@ -238,17 +238,18 @@ add_task(async function test_devtools_pa
     // event has been received.
     window.TEST_PANEL_GLOBAL = "test_panel_global";
 
     browser.test.sendMessage("devtools_panel_inspectedWindow_tabId",
                              browser.devtools.inspectedWindow.tabId);
   }
 
   const longPrefix = (new Array(80)).fill("x").join("");
-  const EXTENSION_ID = `${longPrefix}@create-devtools-panel.test`;
+  // Extension ID includes "inspector" to verify Bug 1474379 doesn't regress.
+  const EXTENSION_ID = `${longPrefix}-inspector@create-devtools-panel.test`;
 
   let extension = ExtensionTestUtils.loadExtension({
     useAddonManager: "temporary",
     manifest: {
       devtools_page: "devtools_page.html",
       applications: {
         gecko: {id: EXTENSION_ID},
       },
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -9,17 +9,18 @@ const SOURCE_MAP_WORKER = "resource://de
 const MAX_ORDINAL = 99;
 const SPLITCONSOLE_ENABLED_PREF = "devtools.toolbox.splitconsoleEnabled";
 const SPLITCONSOLE_HEIGHT_PREF = "devtools.toolbox.splitconsoleHeight";
 const DISABLE_AUTOHIDE_PREF = "ui.popup.disable_autohide";
 const HOST_HISTOGRAM = "DEVTOOLS_TOOLBOX_HOST";
 const SCREENSIZE_HISTOGRAM = "DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER";
 const CURRENT_THEME_SCALAR = "devtools.current_theme";
 const HTML_NS = "http://www.w3.org/1999/xhtml";
-const REGEX_PANEL = /webconsole|inspector|jsdebugger|styleeditor|netmonitor|storage/;
+const REGEX_PANEL =
+  /^(?:webconsole|inspector|jsdebugger|styleeditor|netmonitor|storage)$/;
 
 var {Ci, Cc} = require("chrome");
 var promise = require("promise");
 var defer = require("devtools/shared/defer");
 const { debounce } = require("devtools/shared/debounce");
 var Services = require("Services");
 var ChromeUtils = require("ChromeUtils");
 var {gDevTools} = require("devtools/client/framework/devtools");