Bug 593536 - Hide the Inspector behind a pref, r=gavin, a=blocking2.0
This commit is contained in:
@@ -1030,3 +1030,6 @@ pref("services.sync.prefs.sync.signon.rememberSignons", true);
|
||||
pref("services.sync.prefs.sync.spellchecker.dictionary", true);
|
||||
pref("services.sync.prefs.sync.xpinstall.whitelist.required", true);
|
||||
#endif
|
||||
|
||||
// disable the Inspector
|
||||
pref("devtools.inspector.enabled", false);
|
||||
|
||||
@@ -535,6 +535,7 @@
|
||||
<menuseparator id="devToolsSeparator"/>
|
||||
<menuitem id="menu_pageinspect"
|
||||
type="checkbox"
|
||||
hidden="true"
|
||||
label="&inspectMenu.label;"
|
||||
accesskey="&inspectMenu.accesskey;"
|
||||
key="key_inspect"
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
<command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
|
||||
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
|
||||
<command id="Tools:Inspect" oncommand="InspectorUI.toggleInspectorUI();"/>
|
||||
<command id="Tools:Inspect" oncommand="InspectorUI.toggleInspectorUI();" disabled="true"/>
|
||||
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
|
||||
<command id="Tools:Sanitize"
|
||||
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
|
||||
|
||||
@@ -1513,6 +1513,16 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
||||
|
||||
TabView.init();
|
||||
|
||||
// Enable Inspector?
|
||||
let enabled = gPrefService.getBoolPref(InspectorUI.prefEnabledName);
|
||||
if (enabled) {
|
||||
document.getElementById("menu_pageinspect").setAttribute("hidden", false);
|
||||
document.getElementById("Tools:Inspect").removeAttribute("disabled");
|
||||
let appMenuInspect = document.getElementById("appmenu_pageInspect");
|
||||
if (appMenuInspect)
|
||||
appMenuInspect.setAttribute("hidden", false);
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
|
||||
}
|
||||
|
||||
|
||||
@@ -545,6 +545,7 @@
|
||||
oncommand="HUDConsoleUI.toggleHUD();"
|
||||
key="key_webConsole"/>
|
||||
<menuitem id="appmenu_pageInspect"
|
||||
hidden="true"
|
||||
label="&inspectMenu.label;"
|
||||
type="checkbox"
|
||||
command="Tools:Inspect"
|
||||
|
||||
@@ -336,6 +336,7 @@ var InspectorUI = {
|
||||
showTextNodesWithWhitespace: false,
|
||||
inspecting: false,
|
||||
treeLoaded: false,
|
||||
prefEnabledName: "devtools.inspector.enabled",
|
||||
|
||||
/**
|
||||
* Toggle the inspector interface elements on or off.
|
||||
|
||||
Reference in New Issue
Block a user