Don't forget Mike Ratcliffe, I think he's the one who actually committed the
patch!

For getting started extending Firebug, you'll want to have a look at Honza's
excellent tutorials:
http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug-hello-world-part-i/

My inspector patch works like most other listeners in Firebug.  You add a
listener object which has function names which match the names of the
events.  For example:

Firebug.Inspector.addListener( {
   "onInspectNode": function ( context, theNode) {
       // do something to theNode
    },
    "onStopInspecting": function() {
      // stop messing with theNode
    }
 });


Mike

On Mon, Dec 7, 2009 at 11:43 AM, ceyal <[email protected]> wrote:

> Hi,
> many many thanks about the patch!! (thanks to Mike Collins as well!)
> this is exactly what I needed!
>
> the only thing is that I'm a beginner in XUL/JS and I just can't make
> it work..
> .
> would you do me huge favor and write me an example how can i use the
> new events in my external addon
> so i can get the HTML object/Xpath received by the inspector?
>
> thanks again!
> Eyal
>
> On Dec 5, 3:08 am, John J Barton <[email protected]> wrote:
> > On Dec 4, 2:32 pm, ceyal <[email protected]> wrote:
> >
> > > Hi John,
> > > thanks to you I've managed to create a Firebug extension that turn on
> > > the inspector. :)
> >
> > You might be interested inhttp://
> code.google.com/p/fbug/issues/detail?id=2550
> > Issue 2550:      Dispatch events to Inspector listeners so extensions
> > can listen for inspect events.
> >
> > > maybe I'm not using the correct terminology but ...
> > > I'm looking for a way to save the HTML object location (which the user
> > > pressed on during the inspection)
> > > so i can locate it in the future (something like recording the user
> > > clicks....)
> >
> > > is it possible?
> >
> > You can use the html panel's getObjectPath() function. There are also
> > some XPATH function in lib.js.
> >
> > In general this is an unsolved problem, since the DOM can change
> > arbitrarily as soon as you release control of execution.
> >
> > jjb
> >
> > > thanks ALOT!!
> > > Eyal
> >
> > > On Dec 4, 7:04 pm, John J Barton <[email protected]> wrote:
> >
> > > > On Dec 4, 12:28 am, ceyal <[email protected]> wrote:
> >
> > > > > i meant CSS Selector (the path to the html element that the user
> > > > > clicked on)
> > > > > is there a way to catch the click and the CSS Selector?
> >
> > > > I thought a CSS Selector was a rule for finding elements, a query
> that
> > > > can match many elements. I did not know that elements have a CSS
> > > > selector.
> >
> > > > In any case, Firebug's inspector gives the element itself. No path or
> > > > selector is involved.
> >
> > > > jjb
> >
> > > > > i've considered creating a firebug extension but i want to create
> my
> > > > > own menu (without firebug's menu)....
> >
> > > > > On Dec 4, 3:48 am, John J Barton <[email protected]>
> wrote:
> >
> > > > > > On Dec 3, 2:44 pm, ceyal <[email protected]> wrote:
> >
> > > > > > > thanks a lot!
> > > > > > > after executing the inspect function,
> > > > > > > can i catch the user click on the page to get the CSS
> Selection?
> >
> > > > > > Well you can listen for the click, but I don't know what a CSS
> > > > > > Selection is so I can't help you there.
> >
> > > > > > (Have you considered creating a Firebug extension?)
> >
> > > > > > jjb
> >
> > > > > > > On Dec 4, 12:27 am, John J Barton <[email protected]>
> wrote:
> >
> > > > > > > > On Dec 3, 12:29 pm, ceyal <[email protected]> wrote:
> >
> > > > > > > > >  thanks John,
> > > > > > > > >  I know about the code,
> > > > > > > > >   the question is different -
> >
> > > > > > > > >  I want to call firebug "inspect" function from ANOTHER
> FireFox addon.
> >
> > > > > > > > If you overlay browser.xul, then you can all any Firebug
> function that
> > > > > > > > Firebug can call the same way we call it. So you could call
> > > > > > > > Firebug.Inspector.toggleInspecting(FirebugContext);
> > > > > > > > But the inspect feature is not a function that returns an
> element.
> >
> > > > > > > > jjb
> >
> > > > > > > > >  I believe I need Firebug API for this... or am i wrong?
> > > > > > > > >  thanks,
> > > > > > > > > Eyal
> >
> > > > > > > > > On Dec 3, 9:51 pm, John J Barton <
> [email protected]> wrote:
> >
> > > > > > > > > > On Dec 3, 9:54 am, ceyal <[email protected]> wrote:
> >
> > > > > > > > > > > Hi all,
> > > > > > > > > > > I want to develop a new FF add-on that will use some
> features of
> > > > > > > > > > > Firebug.
> > > > > > > > > > > the basic idea is to activate the inspect element
> function  from
> > > > > > > > > > > within my addon and receive the html element (which the
> user has
> > > > > > > > > > > clicked on) as a CSS Selection result.
> >
> > > > > > > > > > > Does anyone have any idea if this is possible and how?
> >
> > > > > > > > > > Sure its possible. The source is here:
> http://code.google.com/p/fbug/source/checkout
> > > > > > > > > > jjb
> >
> > > > > > > > > > > Thanks,
> > > > > > > > > > > Eyal
>
> --
>
> 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]<firebug%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/firebug?hl=en.
>
>
>

--

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 
http://groups.google.com/group/firebug?hl=en.


Reply via email to