enable error reporting to the console with xulrunner 6
Axel <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpfe |
|---|---|
| Message-ID | <[email protected]> |
Hello
I m trying XULRunner 6 and I don't manage to get javascript errors
(syntax, exceptions, etc) reported in the console/jsconsole.
My profile preferences are :
pref("browser.dom.window.dump.enabled", true);
pref("devtools.chrome.enabled", true);
pref("devtools.errorconsole.enabled", true);
pref("dom.report_all_js_exceptions", true");
pref("extensions.logging.enabled", true);
pref("javascript.options.showInConsole", true);
pref("javascript.options.strict", true);
pref("nglayout.debug.disable_xul_cache", true);
pref("nglayout.debug.disable_xul_fastload", true);
window.dump() works well, as does
Components.interfaces.nsIConsoleService interface.
But Components.utils.reportError() does not work and JS syntax errors
are not reported either.
My test sample is as shortest as possible : a single empty window and a
loaded JS script file. I tried both i686 & x86_64 runtimes and I didnt
find anything recently related in the bugzilla.
Here is the sample :
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="foo">
<script type="application/javascript" src="window-main.js"/>
<button label="click" oncommand="foo('click');"/>
</window>
the window-main.js contents is :
function foo(str)
{
window.dump(str);
Components.utils.reportError('error : ' + str);
Components.classes['@mozilla.org/consoleservice;1']
.getService(Components.interfaces.nsIConsoleService)
.logStringMessage(('nsiconsoleservice : ' + str);
}
foo('startup');
The logged messages in the console (same for the jsconsole) are comes
from window.dump() and nsiconsoleservice, but not from the reportError()
function.
Did I forget something in my preferences ?