← Back to release summary

AbortSignal in addEventListener

Category
DOM
Type
Chromium catches up
Status
Enabled by default (Chrome 90)
Intent stage
Shipped

Summary

This feature adds a new AbortSignal option, named "signal", to the options parameter of addEventListener(). The "signal" option must first be created by an AbortController by accessing the "signal" property on an AbortController instance. Once the signal is passed in to addEventListener, calling "abort()" on the AbortController will remove the event listener added with addEventListener. For more context, see https://github.com/whatwg/dom/issues/911.

Motivation

This feature has been implemented in NodeJS and has developer interest as seen in this issue: https://github.com/whatwg/dom/issues/911

Standards & signals

View on chromestatus.com