Using the js debug console with XULRunner

Aug 17 2009 Author: Brandon Orther

When developing XULRunner applications it is very useful to get all the errors, warnings and messages. There are 2 things you need to do when running your application to get the JS Console to open with all debug messages. First create a file called debug.js in your defaults/preferences/ folder with the following:

/* debugging prefs */
pref("browser.dom.window.dump.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);

Now the only thing you need to do is use the -jsconsole flag when starting your xulrunner application from the command line.

xulrunner path/to/application.ini -jsconsole