W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2015

RE: Callback when an event handler has been added to a custom element

From: Travis Leithead <travis.leithead@microsoft.com>
Date: Fri, 6 Nov 2015 00:16:09 +0000
To: Mitar <mmitar@gmail.com>, public-webapps <public-webapps@w3.org>
Message-ID: <BLUPR03MB389496E9D06BA658A30E694F8280@BLUPR03MB389.namprd03.prod.outlook.com>
Interesting. Alternatively, you can add .onwhatever handlers, as well as define your own overload of addEventListener (which will be called instead of the EventTarget.addEventListener method). That way you can capture all attempts at setting events on your element.

-----Original Message-----
From: Mitar [mailto:mmitar@gmail.com] 
Sent: Thursday, November 5, 2015 4:05 PM
To: public-webapps <public-webapps@w3.org>
Subject: Callback when an event handler has been added to a custom element


We are using message ports to communicate with our logic and are wrapping the API into a custom element. The issue is that we would like to call start on a message port only after user has registered an event handler on the custom element instance. But it seems there is no way to get a callback when an event handler is added.

So I am suggesting that there should be a callback every time an event listener is added to a custom element (and possibly one when removed).




Received on Friday, 6 November 2015 00:16:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:58 UTC