[英]Firefox Extension Developement how to debug preferences page?
How do I debug, like console.log(); 我如何调试,例如console.log(); the Preferences Page of the Extension?
扩展程序的“首选项”页面? Thanks
谢谢
您应该能够使用Firebug.Console.log()
使用Firebug进行调试。
I would just use window.dump
. 我只会使用
window.dump
。 If you really want the Firebug console, you could probably get a reference to main browser window using: 如果您确实想要Firebug控制台,则可以使用以下方法获取对浏览器主窗口的引用:
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
. ( 从此处开始 ),然后调用
mainWindow.console.log
。 Haven't tried it, but I think it should work. 还没有尝试过,但是我认为它应该可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.