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

Middle click events

0 views
Skip to first unread message

Ryan Li

unread,
Nov 24, 2009, 10:16:28 PM11/24/09
to dev-ext...@lists.mozilla.org
Hi all,

I'm developing an extension, which need to catch middle click events on
all input elements.
I know I need to add event listeners. Do I have to add the listeners
manually on every input element each time a new document is loaded? But
window.addEventListener("load", ...) seems to work only when Firefox is
started, it doen't work for new pages. Could anyone guide me how to do this?

Thanks,
Ryan Li

John J. Barton

unread,
Nov 25, 2009, 12:29:31 AM11/25/09
to

Look up "capturing" for event listeners. Be patient, the explanations
are confusing. But the short version is that you can add an listener to
the top of the tree (document) which is "capturing" and get the event
first. So a capturing event listener for click events, checking on the
target and click type.

Yes, you have to add the listeners manually on every new document. I
wonder if 'jetpack' makes this any easier?

jjb

0 new messages