views:

41

answers:

1
  • Firefox 3.6.8
  • Firebug 1.5.4

I'm trying to write a Firefox extension that uses Firebug. I've gotten up and running with the Firefox extension part but I just can't seem to access Firebug. I've followed various tutorials and dug into the code of other Firebug extensions (such as FirePHP). From what I can tell, this should work (at it's simplest):

<?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"&gt;

<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 is always coming back as undefined. If I call "Firebug.Console.log(whatever)", Firebug will also be undefined. If I call it later on (let's say, after a menu item is hit) it will work. It's definitely a loading issue but I can't figure it out.

Thanks.

A: 

You can ask on the Firebug newsgroup. http://groups.google.com/group/firebug I guess you are not overlaying successfully, try adding window.alert(window.location.toString()) to your JS before FBL.ns

johnjbarton
Thanks John. Are you the man behind FireDiff? I decided to use the source to get an idea of why mine wasn't working and I recognized your name. Anyway, I appreciate the help!
Ryan