2010-08-17 153 views
0
  • 火狐3.6.8
  • 螢火蟲1.5.4

我想要編寫使用Firebug的Firefox擴展。我已經啓動並運行Firefox擴展部分,但我似乎無法訪問Firebug。我遵循各種教程,並深入其他Firebug擴展(如FirePHP)的代碼。從我可以告訴,這應該工作(在它是最簡單的):擴展螢火蟲(螢火蟲/ FBL未定義)

<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="chrome://implementor/skin/overlay.css" type="text/css"?> 

<overlay id="implementor-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 

<script> 
    FBL.ns(function() { with (FBL) { 

    HelloWorldPanel = function() {} 

    HelloWorldPanel.prototype = extend(Firebug.Panel, 
    { 
     name: "HelloWorld", 
     title: "Hello World!", 

     initialize: function() { 
      Firebug.Panel.initialize.apply(this, arguments); 
     }, 
    }); 

    Firebug.registerPanel(HelloWorldPanel); 

    }}); 
</script> 


</overlay> 

FBL總是回來未定義。如果我打電話「Firebug.Console.log(無論)」,Firebug也將是未定義的。如果我稍後調用它(比方說,在菜單項被擊中後),它將起作用。這絕對是一個加載問題,但我無法弄清楚。

謝謝。

回答

0

你可以問Firebug新聞組。 http://groups.google.com/group/firebug 我想你沒有成功覆蓋,嘗試添加window.alert(window.location.toString())到你的JS之前FBL.ns

+0

謝謝約翰。你是FireDiff後面的人嗎?我決定使用源代碼來了解爲什麼我的工作不正常,並且我認出了你的名字。無論如何,我感謝幫助! – Ryan 2010-08-27 23:58:57