views:

14

answers:

2

How do I debug, like console.log(); the Preferences Page of the Extension? Thanks

A: 

I would just use window.dump. If you really want the Firebug console, you could probably get a reference to main browser window using:

var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
               .getInterface(Components.interfaces.nsIWebNavigation)
               .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
               .rootTreeItem
               .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
               .getInterface(Components.interfaces.nsIDOMWindow); 

(from here) and then call mainWindow.console.log. Haven't tried it, but I think it should work.

MatrixFrog
+1  A: 

You should be able to debug with Firebug, using Firebug.Console.log().

Felix Kling