Bug 1387482 - default to true when reading pref devtools.inspector.enabled from Firefox;r=mixedpuppy draft
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 04 Aug 2017 17:55:51 +0200
changeset 642583 f78a2034f1e0dce3a65669e69ef8ab97242c5eaf
parent 642571 02e5974fe43c6956718a245e567b78639c126adb
child 725047 b842154480e8d1e9401f4caea86bb3c6c64a734f
push id72811
push userjdescottes@mozilla.com
push dateTue, 08 Aug 2017 14:35:45 +0000
reviewersmixedpuppy
bugs1387482
milestone57.0a1
Bug 1387482 - default to true when reading pref devtools.inspector.enabled from Firefox;r=mixedpuppy 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)) {