Mozilla #JetPack: Create a simple debugger

Categories Jetpack, Kindle, Mozilla, Technologies

So I wanted to create a simple JetPack debugger that will write me some data and will dump me some objects on my …Firefox error console.

Here is the code. This simple tutorial shows :

0. How to use some of Firefox Services via Services.jsm
1. How to work with nsIConsoleService

Why I need that? Well I want to debug some of my extensions without using console/notifications or Firebug. This can be usable for getting better support for users. You can always put some debug lines on your code that will be visible for your addon user.

Anyway this is an example library and it’s not for production use :)


  • PJ
    May 27, 2011

    Maybe it can be called logger, instead of debugger. I like it – it can be useful if you are using online builder at AMO website.

    Thanks for writing this tutorials Bogo!!!

  • Jeff Griffiths
    May 28, 2011

    I like the approach, console.log is very useful but not implemented on Firefox 3.x. You could easily adjust your code to just implement a workable console.log if it doesn’t exist, sort of like this:

    • Bogo
      May 30, 2011

      Jeff Griffiths: Awesome, thanks for the fork :)

Leave a Reply to Jeff Griffiths Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.