W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2010

Re: Introspection on events

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Fri, 26 Nov 2010 12:01:30 +0200
Message-ID: <4CEF857A.7040508@helsinki.fi>
To: Brett Zamir <brettz9@yahoo.com>
CC: "www-dom@w3.org" <www-dom@w3.org>
On 11/26/2010 05:47 AM, Brett Zamir wrote:
> Hi,
>
> My apologies if this is or has been well covered, but I'd like to know
> whether there has been consideration for allowing introspection of
> events already attached to elements or objects?

I guess you mean "event listeners already added to elements".

And yes, this has been discussed earlier.

>
> I'd like to be able to get the event types, attached function(s),
> whether capturing or not, etc., and possibly also access which events
> could come through the element via bubbling, or precede it by capturing.
>
> I think this could be useful in IDEs, during debugging (and in tools
> such as Firebug),
IDEs and tools like Firebug can use browser specific APIs. No
need to expose everything to web content.
(Firebug, or at least one its extensions uses
http://mxr.mozilla.org/mozilla-central/source/content/events/public/nsIEventListenerService.idl
to look at which listeners are added to an event target)




> and also assist when one wishes to dynamically remove
> all events on an element. No doubt there could be a good number of other
> interesting use cases.
Well, if a web page wants to remove all the listeners it has added, it
sure knows what those listeners are.

There are listeners which web page should not get access to.
For example the listeners added by UA, or some extension or
Greasemonkey.

>
> (This might be especially handy if Mozilla's toSource() could become
> standardized as well, even if it isn't able to be used to rebuild
> closures.)
You mean toSource() in nsIEventListenerInfo? Please file a bug for
the issue you're seeing.


-Olli



>
> thank you,
> Brett Zamir
>
>
>
Received on Friday, 26 November 2010 10:02:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:06 GMT