简体   繁体   中英

Firefox Extension Developement how to debug preferences page?

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

您应该能够使用Firebug.Console.log()使用Firebug进行调试。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM