I'm writing a plugin that is reusing the inspector code in firebug. Since I 
need to change some of the behavior of how the inspector works, I thought 
the best course of action would be to extend Firebug.Inspector and override 
the functions I need to change. I started out with overriding 
onInspectingClick, and I am not seeing the results I expect when moving the 
mouse cursor around the page. I do see my sysout statement (FBTrace.sysout("** 
QRUCIBL: onInsp[...])is showing up in FBTrace every time I click, but as I 
mouseover, I do not see the highlighting nor is the HTML tab is scrolling 
to dom element that the mouse is on top of. In addition, as I mouseover the 
page, the error console repeatedly shows "TypeError: context is null \ 
Source File: chrom://firebug/content/html/inspector.js". Can anyone comment 
on the errors of my approach and guide me to overcoming these problems? 
Thank you!

*.../content/qruciblInspector.js:*
define([
    "firebug/lib/lib",
    "firebug/lib/trace",
    "firebug/html/inspector",
],
function(FBL, FBTrace) {

Firebug.QruciblInspector = FBL.extend(Firebug.Inspector,
{
    onInspectingClick: function(event)
    {
        if (FBTrace.DBG_INSPECT) {
            FBTrace.sysout("onInspectingClick event", event);
            FBTrace.sysout("** QRUCIBL: onInspectingClick event", event);
        }
        
        var win = event.currentTarget.defaultView;
        if (win)
        {
            win = Win.getRootWindow(win);
            this.detachClickInspectListeners(win);
        }

        Events.cancelEvent(event);
    }
});

return Firebug.QruciblInspector;

});

The overridden inspector is called from a new panel I added. A button on 
that panel executes the Firebug.QruciblInspector.toggleInspecting function 
when clicked:  

*.../content/myPanel.js:*
[snip]
    /**
     * Extends toolbar for this panel.
     */
    getPanelToolbarButtons: function()
    {
        var buttons = [];

        buttons.push({
            label: "qrucibl.button.recordflow.label",
            tooltiptext: "qrucibl.button.recordflow.tooltip",
            command: FBL.bindFixed(this.onFlowRecord, this)
        });

        return buttons;
    },

    onFlowRecord: function()
    {
        Firebug.QruciblInspector.toggleInspecting(Firebug.currentContext);
    }
[snip]

-- 
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug

Reply via email to