Bug 1474379 - Match regex against the entire panel ID. r=miker,rpl
authorIan Moody <moz-ian@perix.co.uk>
Tue, 10 Jul 2018 17:38:35 +0100
changeset 426585 75ee38b6550f
parent 426584 7b32e48fadc5
child 426586 18c5ad6ddb9e
push id34276
push userncsoregi@mozilla.com
push dateSat, 14 Jul 2018 09:41:08 +0000
treeherdermozilla-central@04dd259d71db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker, rpl
bugs1474379
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1474379 - Match regex against the entire panel ID. r=miker,rpl 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
@@ -8,17 +8,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 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");
 const { debounce } = require("devtools/shared/debounce");
 var Services = require("Services");
 var ChromeUtils = require("ChromeUtils");
 var {gDevTools} = require("devtools/client/framework/devtools");
 var EventEmitter = require("devtools/shared/event-emitter");