Honza, I did read that article, but I did not see where I could override 
the functionality that I require. I'm researching how to leverage FB to 
write a plugin that will record the user's interaction (events, keyboard 
input, etc) with a webpage. 

I need the following behavior: The user clicks a "record" button that I 
have added to the UI. As the user moves the mouse on the page, dom nodes 
should highlight (as the inspector already does), but when the user clicks 
a node, the "recorder" should trap the event similarly to how FB currently 
does - except, the event is recorded by my code and, if node is a form 
field, record the user's keyboard input or selections from the dropdown. 
When the user loses focus on the field, the inspector/recorder continues 
this highlighting and recording until the user clicks a "Stop" button, 
which I have added to the UI.

I didn't see how the listeners could be used to achieve this behavior. At 
this point, I think my best option is to include the FB source in my module 
and reuse FB methods/modules where possible and rewrite listener code where 
it's not possible to reuse/extend. Do you agree or should I look at some 
other options?

On Monday, December 10, 2012 7:26:05 AM UTC-5, Jan Honza Odvarko wrote:
>
> Have you read this post:
>
> http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug-inspector-part-x/
>
> Does it help?
>
> Honza
>
> On Wednesday, December 5, 2012 6:22:13 PM UTC+1, Patrick Nolan wrote:
>>
>> 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