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 :)
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:
https://github.com/canuckistani/jetpack-console.log-injection-example
Jeff Griffiths: Awesome, thanks for the fork :)
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!!!