Bug 593536 - Hide the Inspector behind a pref, r=gavin, a=blocking2.0

This commit is contained in:
Rob Campbell
2010-09-09 18:52:43 -03:00
parent 01e86633a4
commit 51dd179927
6 changed files with 17 additions and 1 deletions

View File

@@ -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);

View File

@@ -535,6 +535,7 @@
<menuseparator id="devToolsSeparator"/>
<menuitem id="menu_pageinspect"
type="checkbox"
hidden="true"
label="&inspectMenu.label;"
accesskey="&inspectMenu.accesskey;"
key="key_inspect"

View File

@@ -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);"/>

View File

@@ -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", "");
}

View File

@@ -545,6 +545,7 @@
oncommand="HUDConsoleUI.toggleHUD();"
key="key_webConsole"/>
<menuitem id="appmenu_pageInspect"
hidden="true"
label="&inspectMenu.label;"
type="checkbox"
command="Tools:Inspect"

View File

@@ -336,6 +336,7 @@ var InspectorUI = {
showTextNodesWithWhitespace: false,
inspecting: false,
treeLoaded: false,
prefEnabledName: "devtools.inspector.enabled",
/**
* Toggle the inspector interface elements on or off.