W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

Re: [whatwg] Detecting eventListeners

From: Xavier Ho <contact@xavierho.com>
Date: Fri, 25 May 2012 13:07:03 +1000
Message-ID: <CALWePYwSkBwqym2HommY+c_opHhGqsF62G9vCCP1qw-3__hqhw@mail.gmail.com>
To: Kyle Huey <me@kylehuey.com>
Cc: whatwg@whatwg.org
Hello Kyle,

On 25 May 2012 12:56, Kyle Huey <me@kylehuey.com> wrote:
> I'll bite.  Why do you care if an EventTarget has registered event
> listeners or not?

We're working on an internal script that does something similar to Selenium
IDE plugin on Firefox, which records user interactions based on page
submission, event triggers, and form input.

A very common use-case is to record a mouse click on a DOM element which
may fire an event on the page.  We want to capture clicks that actually
triggered an event, does a HTTP request, and so on, but not meaningless
clicks on an empty region.

That said, there is no way of surely determining if a click is meaningful.
 We check if the DOM element clicked on is a button, a link (has href), has
onclick attribute set, and so on.  However, this will fail on sites that
binds 'click' via 'addEventListener' on a strange element, like a <span> or
a <em> tag.

We are developing this script for user training and customer tutorials -- a
playback script that moves the mouse, types in forms, interacts with the
webpage -- which so far is almost complete.

Feel free to ask any questions.  I'm the main developer on this project.

Received on Friday, 25 May 2012 03:07:56 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:42 UTC