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
--- 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)) {