Use object highlighter for extension?

66 views
Skip to first unread message

madura pradeep

unread,
Sep 18, 2012, 3:15:49 AM9/18/12
to fir...@googlegroups.com
How to use object highlighter which is used inside html panel, for extensions? Is it possible to give xpath and highlight the element? 

Jan Honza Odvarko

unread,
Sep 18, 2012, 9:52:17 AM9/18/12
to Firebug
There are some APIs exposed to extension, check out this post:
http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug-inspector-part-x/

Not sure if this is what you need.
Honza

madura pradeep

unread,
Sep 20, 2012, 12:50:03 AM9/20/12
to fir...@googlegroups.com
No.I'm not need this.I have the xpath of an element in the open url.I want to highlight the object relevant to that url by using it xpath such as selenium ide do (In selenium ide ,give xpath as target and when click on the find button it highlight the object)

Sebastian Zartner

unread,
Sep 20, 2012, 10:12:16 AM9/20/12
to fir...@googlegroups.com
Is your extension a Firebug extension?
If not, the simplest solution is to select the element(s) via document.evaluate() and then change it's/their style e.g. via element.style.backgroundColor = "yellow";.
If yes, you can reuse the inspector logic like it's done in Firebug.

Sebastian

madura pradeep

unread,
Sep 26, 2012, 9:07:14 AM9/26/12
to fir...@googlegroups.com
My extension is a firebug extension. So still can i use your solution?

Sebastian Zartner

unread,
Sep 26, 2012, 1:13:08 PM9/26/12
to fir...@googlegroups.com
My extension is a firebug extension. So still can i use your solution?
When it's a Firebug extension you should comply with Firebug's UI as far as possible, so it integrates well and gives a good UX. As I told you before you can use Firebug's inspector for this purpose:

Firebug.Inspector.highlightObject(arr, context);

where arr is the array of elements you get via document.evaluate().

Sebastian

madura pradeep

unread,
Oct 3, 2012, 2:48:27 AM10/3/12
to fir...@googlegroups.com
yes, that's work for me.. thank you!

Sebastian Zartner

unread,
Oct 3, 2012, 5:23:13 AM10/3/12
to fir...@googlegroups.com
yes, that's work for me.. thank you!
Great!

Sebastian
Reply all
Reply to author
Forward
0 new messages