125181 - add pref to filter chrome:// errors in javascript console. r=ben sr=hewitt a=asa

This commit is contained in:
blakeross%telocity.com 2002-02-27 00:42:51 +00:00
Родитель 4dc3d4d658
Коммит 98d168e9a6
4 изменённых файлов: 28 добавлений и 2 удалений

Просмотреть файл

@ -343,6 +343,7 @@ pref("dom.disable_open_during_load", false);
pref("javascript.enabled", true);
pref("javascript.allow.mailnews", false);
pref("javascript.options.strict", false);
pref("javascript.options.showInConsole", true);
// advanced prefs
pref("advanced.always_load_images", true);

Просмотреть файл

@ -18,6 +18,23 @@
<field name="limit" readonly="true">
250
</field>
<field name="_showChromeErrors">-1</field>
<property name="showChromeErrors">
<getter><![CDATA[
if (this._showChromeErrors != -1)
return this._showChromeErrors;
var pref = Components.classes['@mozilla.org/preferences-service;1'].getService();
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
try {
return this._showChromeErrors = pref.getBoolPref("javascript.options.showInConsole");
}
catch(ex) {
return this._showChromeErrors = false;
}
]]></getter>
</property>
<property name="count" readonly="true">
<getter>return this.mCount</getter>
@ -115,6 +132,11 @@
try {
// Try to QI it to a script error to get more info
var scriptError = aObject.QueryInterface(Components.interfaces.nsIScriptError);
// filter chrome urls
if (!this.showChromeErrors && scriptError.sourceName.substr(0, 9) == "chrome://")
return;
this.appendError(scriptError);
} catch (ex) {
try {

Просмотреть файл

@ -32,8 +32,8 @@
<![CDATA[
var _elementIDs = ["nglayoutDebugWindow", "nglayoutUseNativePrintDialog", "printUseGlobalPrintSettings",
"debugXULBoxes", "browserDOMWindowDumpEnabled",
"javascriptOptionsStrict", "nglayoutDebugUseXBLForms",
"nglayoutDebugEnableXPCOMRefcntLog",
"javascriptOptionsStrict", "javascriptOptionsShowInConsole",
"nglayoutDebugUseXBLForms", "nglayoutDebugEnableXPCOMRefcntLog",
"acceleratorKeyValue", "menuAccessKeyValue"];
]]>
</script>
@ -71,6 +71,8 @@
prefstring="browser.dom.window.dump.enabled"/>
<checkbox id="javascriptOptionsStrict" label="&debugStrictJavascript.label;"
prefstring="javascript.options.strict"/>
<checkbox id="javascriptOptionsShowInConsole" label="&debugConsoleJavascript.label;"
prefstring="javascript.options.showInConsole"/>
<checkbox id="nglayoutDebugUseXBLForms" label="&debugUseXBLForms.label;"
prefstring="nglayout.debug.enable_xbl_forms"/>
<checkbox id="nglayoutDebugEnableXPCOMRefcntLog" label="&debugEnableXPCOMRefcntLog.label;"

Просмотреть файл

@ -9,6 +9,7 @@
<!ENTITY debugMiscellaneous.label "Miscellaneous">
<!ENTITY debugEnableDump.label "Enable JavaScript dump() output">
<!ENTITY debugStrictJavascript.label "Show strict JavaScript warnings">
<!ENTITY debugConsoleJavascript.label "Show Javascript errors and warnings in Mozilla chrome in the js console">
<!ENTITY debugUseXBLForms.label "Use XBL-based form controls (takes effect after restart). These are still under construction.">
<!ENTITY debugEnableXPCOMRefcntLog.label "Enable XPCOM Refcount Log">