A nifty debugging method with Firefox

Instead of using alert() to debug in Firefox, the dump() method can be used.

Just add the following line to prefs.js:

user_pref("browser.dom.window.dump.enabled", true);

and open a terminal and type:

shell> firefox -console

and try the following command in the address bar:

javascript:dump("hello, world\n");

You can see the text “hello, world” printed in the terminal.

This is much better than alert() since the output can be copied/pasted if necessary.


technorati tags: , ,

One Response to “A nifty debugging method with Firefox”

  1. Fan of Don Lapre Says:

    Yeah, that was tricky.

    Fan of Don Lapre
    larisa@larisajoyreilly.com

Leave a Reply