簡體   English   中英

Firefox擴展開發如何調試首選項頁面?

[英]Firefox Extension Developement how to debug preferences page?

我如何調試,例如console.log(); 擴展程序的“首選項”頁面? 謝謝

您應該能夠使用Firebug.Console.log()使用Firebug進行調試。

我只會使用window.dump 如果您確實想要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); 

從此處開始 ),然后調用mainWindow.console.log 還沒有嘗試過,但是我認為它應該可以工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM