Bug 593538 - Hide the Error Console behind a preference, r=gavin, a=blocking2.0
authorRob Campbell <rcampbell@mozilla.com>
Thu, 09 Sep 2010 19:00:53 -0300
changeset 52334 2aaeb42e51a68f96c36bf49e2b98f44b3fc50f2a
parent 52333 878c39d824a87f3ff14eddbfe55eec4e912353c0
child 52335 bb3b8e8f2b793468d978342addc02a5d42d3c547
push id15602
push userrcampbell@mozilla.com
push dateThu, 09 Sep 2010 22:01:32 +0000
treeherdermozilla-central@2aaeb42e51a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin, blocking2
bugs593538
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 593538 - Hide the Error Console behind a preference, r=gavin, a=blocking2.0
browser/app/profile/firefox.js
browser/base/content/browser-menubar.inc
browser/base/content/browser-sets.inc
browser/base/content/browser.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -390,21 +390,19 @@ pref("browser.bookmarks.autoExportHTML",
 // The maximum number of daily bookmark backups to 
 // keep in {PROFILEDIR}/bookmarkbackups. Special values:
 // -1: unlimited
 //  0: no backups created (and deletes all existing backups)
 pref("browser.bookmarks.max_backups",             10);
 
 // Scripts & Windows prefs
 pref("dom.disable_open_during_load",              true);
+pref("javascript.options.showInConsole",          true);
 #ifdef DEBUG
-pref("javascript.options.showInConsole",          true);
 pref("general.warnOnAboutConfig",                 false);
-#else
-pref("javascript.options.showInConsole",          false);
 #endif
 
 #ifdef WINCE
 // Set the threshold higher to avoid some slow script warnings
 pref("dom.max_script_run_time",                   20);
 #endif
 
 // Make the status bar reliably present and unaffected by pages
@@ -1026,10 +1024,13 @@ pref("services.sync.prefs.sync.security.
 pref("services.sync.prefs.sync.security.warn_leaving_secure", true);
 pref("services.sync.prefs.sync.security.warn_submit_insecure", true);
 pref("services.sync.prefs.sync.security.warn_viewing_mixed", true);
 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 Error Console
+pref("devtools.errorconsole.enabled", false);
+
 // disable the Inspector
 pref("devtools.inspector.enabled", false);
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -536,16 +536,17 @@
               <menuitem id="menu_pageinspect"
                         type="checkbox"
                         hidden="true"
                         label="&inspectMenu.label;"
                         accesskey="&inspectMenu.accesskey;"
                         key="key_inspect"
                         command="Tools:Inspect"/>
               <menuitem id="javascriptConsole"
+                        hidden="true"
                         label="&errorConsoleCmd.label;"
                         accesskey="&errorConsoleCmd.accesskey;"
                         key="key_errorConsole"
                         oncommand="toJavaScriptConsole();"/>
               <menuitem id="webConsole"
                         label="&webConsoleCmd.label;"
                         accesskey="&webConsoleCmd.accesskey;"
                         key="key_webConsole"
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -231,17 +231,17 @@
 #endif
 #ifdef XP_GNOME
     <key id="key_search2" key="&searchFocusUnix.commandkey;" command="Tools:Search" modifiers="accel"/>
     <key id="key_openDownloads" key="&downloadsUnix.commandkey;" command="Tools:Downloads" modifiers="accel,shift"/>
 #else
     <key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
 #endif
     <key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
-    <key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" oncommand="toJavaScriptConsole();" modifiers="accel,shift"/>
+    <key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" oncommand="toJavaScriptConsole();" modifiers="accel,shift" disabled="true"/>
     <key id="key_webConsole" key="&webConsoleCmd.commandkey;" oncommand="HUDConsoleUI.toggleHUD();" modifiers="accel,shift"/>
     <key id="key_inspect" key="&inspectMenu.commandkey;" command="Tools:Inspect" modifiers="accel,shift"/>
     <key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile"  modifiers="accel"/>
     <key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
     <key id="printKb" key="&printCmd.commandkey;" command="cmd_print"  modifiers="accel"/>
     <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/>
     <key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift"/>
     <key id="key_undo"
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1518,16 +1518,23 @@ function delayedStartup(isLoadingBlank, 
   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);
   }
 
+  // Enable Error Console?
+  let consoleEnabled = gPrefService.getBoolPref("devtools.errorconsole.enabled");
+  if (consoleEnabled) {
+    document.getElementById("javascriptConsole").hidden = false;
+    document.getElementById("key_errorConsole").disabled = false;
+  }
+
   Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
 }
 
 function BrowserShutdown()
 {
   if (Win7Features)
     Win7Features.onCloseWindow();