← Back to release summary

addEventListener/removeEventListener EventListenerOptions API

Category
DOM
Type
New or changed feature
Status
Enabled by default (Chrome 49)
Intent stage
None

Summary

Add an additional API to addEventListener/removeEventListener which takes EventListenerOptions dictionary. void [add|remove]EventListener(DOMString type, EventListener listener, EventListenerOptions options); Currently other platforms (Gecko) add additional booleans to the argument list to modify the behavior of the added event listeners. We'd like to turn this into a dictionary (EventListenerOptions) so that is a more flexible API for future work.

Standards & signals

Docs: https://github.com/whatwg/dom/pull/82 https://github.com/RByers/EventListenerOptions https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener

View on chromestatus.com