Bug 1387482 - default to true when reading pref devtools.inspector.enabled from Firefox draft
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 04 Aug 2017 17:55:51 +0200
changeset 621274 33624b95d5e6c4c802a57b8e8ed10992ad43bc87
parent 620862 32083f24a1bb2c33050b4c972783f066432194eb
child 640958 fdea565c47afa1112c2c026d648eb657023dbc52
push id72319
push userjdescottes@mozilla.com
push dateFri, 04 Aug 2017 15:57:48 +0000
bugs1387482
milestone57.0a1
Bug 1387482 - default to true when reading pref devtools.inspector.enabled from Firefox This preference will be moved inside the devtools addon and won't be always available. By default consuemrs should consider this to be true, as the inspector is always enabled by default. If devtools are not installed, the DevToolsShim will be responsible for redirecting the call to inspect node to the devtools installation flow. MozReview-Commit-ID: 279mJ5WRzok
browser/base/content/nsContextMenu.js
browser/base/content/test/general/contextmenu_common.js
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -307,19 +307,18 @@ nsContextMenu.prototype = {
     this.showItem("context-viewpartialsource-mathml",
                   this.onMathML && !this.isContentSelected);
 
     var shouldShow = !(this.isContentSelected ||
                        this.onImage || this.onCanvas ||
                        this.onVideo || this.onAudio ||
                        this.onLink || this.onTextInput);
 
-    var showInspect = DevToolsShim.isInstalled() &&
-                      this.inTabBrowser &&
-                      gPrefService.getBoolPref("devtools.inspector.enabled", false);
+    var showInspect = this.inTabBrowser &&
+                      gPrefService.getBoolPref("devtools.inspector.enabled", true);
 
     this.showItem("context-viewsource", shouldShow);
     this.showItem("context-viewinfo", shouldShow);
     // The page info is broken for WebExtension popups, as the browser is
     // destroyed when the popup is closed.
     this.setItemAttr("context-viewinfo", "disabled", this.webExtBrowserType === "popup");
     this.showItem("inspect-separator", showInspect);
     this.showItem("context-inspect", showInspect);
--- a/browser/base/content/test/general/contextmenu_common.js
+++ b/browser/base/content/test/general/contextmenu_common.js
@@ -310,17 +310,17 @@ async function test_contextmenu(selector
   info("Popup Shown");
 
   if (options.onContextMenuShown) {
     await options.onContextMenuShown();
     info("Completed onContextMenuShown");
   }
 
   if (menuItems) {
-    if (Services.prefs.getBoolPref("devtools.inspector.enabled")) {
+    if (Services.prefs.getBoolPref("devtools.inspector.enabled", true)) {
       let inspectItems = ["---", null,
                           "context-inspect", true];
       menuItems = menuItems.concat(inspectItems);
     }
 
     if (options.maybeScreenshotsPresent &&
         !Services.prefs.getBoolPref("extensions.screenshots.disabled", false) &&
         !Services.prefs.getBoolPref("extensions.screenshots.system-disabled", false)) {