XULRunner will drop messages passed to console.log() unless you attach a debugger to it. This can be achieved by remote debugging: XULRunner as debuggee, firefox as debugger. Once the debugger attached to the XULRunner app, you can see console.log()ed messages in the debugger.
Instruction for remote debgging can be found at MDN.
You may also want to set devtools.debugger.remote-enabled
pref of your firefox to true
.
Use this code in your app:
var windowtype = ...
Components.utils.import('resource://gre/modules/devtools/dbg-server.jsm');
DebuggerServer.chromeWindowType = windowtype;
if (!DebuggerServer.initialized) {
DebuggerServer.init();
DebuggerServer.addBrowserActors(windowtype);
}
DebuggerServer.openListener(6000);
If your page is (x)html, assign windowtype
with null
; if your page is xul, assign windowtype
with the same value of the windowtype attribute of the xul:window
element:
<xul:window windowtype=... >
...
</xul:window>