Firefox Javascript Debugging


I’ve got the week off for Thanksgiving, so I had a chance to get back to coding searchmash. I was planning on tackling the back button support, but ended up spending the day on a perplexing Firefox issue.

One great thing about debugging Safari is being able to output text to the console using “window.console.log()”. It’s not as good as MS’s free script debugger, but it’s a lot better than using alert()’s.

I eventually found a way, but it was not well documented, so here’s a quick walk-through:

  • Type about:config in Firefox’s address bar.
  • You should now see a list of names and values in the main window.
  • Right-click anywhere in the window, and chose New->Boolean from the menu.
  • In the box that comes up, put in browser.dom.window.dump.enabled
  • In the next box, chose true

You can now call window.dump(), and the string you pass in will appear in the system console. On the Mac, this is visible in the /Applications/Utilities/ program.

One response

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: