Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bookmark EventListener

147 views
Skip to first unread message

Lorne Kates

unread,
Nov 7, 2006, 11:50:12 PM11/7/06
to
Hi, there,

I'm in the process of writing an extension that reacts to bookmarks.
However, I'm having trouble trying to get my extension to "hear" a
selected bookmark.

The extension is a xul program that calls a javascript script. When I
was doing the inital "learn to write an extension", I could capture
general clicks with

window.addEventListener("click", functionIRun()....)

Now, I need to listen for whenever a single bookmark is clicked. I've
read through lxr, and tried Google My Friend, but haven't found the
answer yet. Which event would I listen for, and where would I put the
event listener, if I wanted to capture every bookmark load:

???.addEventListener("???",...)

Thanks in advance,
Lorne Kates

mark bokil

unread,
Nov 8, 2006, 10:12:18 AM11/8/06
to dev-ext...@lists.mozilla.org
Lorne Kates wrote:
> Hi, there,
>
> I'm in the process of writing an extension that reacts to bookmarks.
> However, I'm having trouble trying to get my extension to "hear" a
> selected bookmark.
>
> The extension is a xul program that calls a javascript script. When I
> was doing the inital "learn to write an extension", I could capture
> general clicks with
>
> window.addEventListener("click", functionIRun()....)
Look through the DOM using the Inspector. Find the id for the menupopup
of the bookmarks. Add a click event to the bookmarks menupopup. You
could then evaluate the target of the event that occurs to determine the
url of the bookmark clicked. Do a search for target event xul.
0 new messages