Inspecting with rigth-click

28 views
Skip to first unread message

andineupert

unread,
Feb 10, 2012, 10:16:16 AM2/10/12
to Firebug
Hey guys,

I want to let my firebug extension behave different if I inspect with
a right-click and not with a left-click. Is it possible to
differentiate between left and right-click in stopInspecting?

Thanks

Sebo

unread,
Feb 10, 2012, 10:56:13 AM2/10/12
to fir...@googlegroups.com
I guess that should work by handling onInspectingClick. In there you have to check for event.button == 2.
Please note, that it could be, that there will be a context menu in the future. See therefore my comments in issue 551.

Sebastian

andineupert

unread,
Feb 10, 2012, 11:47:04 AM2/10/12
to Firebug
And how can I handle onInpectingClick?

Thanks!
> future. See therefore my comments in issue 551<http://code.google.com/p/fbug/issues/detail?id=551#c6>
> .
>
> Sebastian

Sebo

unread,
Feb 10, 2012, 1:03:50 PM2/10/12
to fir...@googlegroups.com, odv...@gmail.com
And how can I handle onInpectingClick?

Thanks!
Hmm, I thought it was possible. Though it seems the Inspector currently just dispatches onStartInspecting, onInspectNode, onStopInspecting, onBeginFirebugChange and onEndFirebugChange.
Honza, do you see a way to react to the click event before the Inspector does?

Sebastian

Jan Honza Odvarko

unread,
Feb 13, 2012, 6:31:13 AM2/13/12
to fir...@googlegroups.com, odv...@gmail.com

One possible solution could be to monkey patch the onInspectClick (override Firebug.Inspector.onInspectingClick and call the original after custom logic
But this is rather a hack that could stop working if the internals change (no change is planned but)

Anyway, I would personally concentrate rather on onInspectingMouseUp that is also responsible for calling stopInspecting. Also, we could enhance the current Inspector APIs
(http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug-inspector-part-x/)
and pass the event object from onInspectingMouseUp to stopInspecting as third argument. Other option could be designing a new inspector callback (e.e. onInspectingMouseUp, that gets the event object)

If you are interested in enhancing the API, please create a new issue report and we can discuss further.

Honza





Sebastian

Sebo

unread,
Feb 21, 2012, 6:43:56 AM2/21/12
to fir...@googlegroups.com, odv...@gmail.com
And how can I handle onInpectingClick?

Thanks!
Hmm, I thought it was possible. Though it seems the Inspector currently just dispatches onStartInspecting, onInspectNode, onStopInspecting, onBeginFirebugChange and onEndFirebugChange.
Honza, do you see a way to react to the click event before the Inspector does?

One possible solution could be to monkey patch the onInspectClick (override Firebug.Inspector.onInspectingClick and call the original after custom logic
But this is rather a hack that could stop working if the internals change (no change is planned but)

Anyway, I would personally concentrate rather on onInspectingMouseUp that is also responsible for calling stopInspecting. Also, we could enhance the current Inspector APIs
(http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug-inspector-part-x/)
and pass the event object from onInspectingMouseUp to stopInspecting as third argument.
Because stopInspecting() doesn't have to be called by an event, this doesn't seem to be the right solution.

Other option could be designing a new inspector callback (e.e. onInspectingMouseUp, that gets the event object)
That would make more sense in my eyes. It would give full control over the inspection process.
 
If you are interested in enhancing the API, please create a new issue report and we can discuss further.
I guess that was meant for andineupert because I am currently not planning to enhance the API. Though it might change when we implement the new Inspector.

Sebastian
Reply all
Reply to author
Forward
0 new messages