addEventListener(type, callback, options) takes either a boolean (meaning capture) or an options object:
captureregisters the listener for the capture phase, so an ancestor hears the event before the target does. Defaultfalse.onceremoves the listener just before its first call, even if the callback then throws.passivedeclares that the listener won't callpreventDefault(); if it does, the call is ignored and Chrome logs "Unable to preventDefault inside passive event listener invocation." Fortouchstart,touchmoveandwheel, the browser can then scroll without waiting for script, which is why non-passive listeners for them cause scroll jank. Whenpassiveisn't given, those event types onwindow,document,<html>or<body>default to passive.signaltakes anAbortSignal; aborting it removes the listener. OneAbortControllercan remove a whole component's listeners at once, with no function references kept. A signal that is already aborted means the listener is never added.
A listener is identified by type, callback and capture. Adding the same trio again is ignored, even with different once or passive values, and removeEventListener() looks only at those three. So a listener added with capture: true must be removed with capture: true.
Event handler properties (el.onclick = fn) hold one handler per event type. Assigning replaces it, null removes it, and returning false cancels the event. The first non-null assignment adds a non-capture listener at that point in the list; later assignments keep that position.
Support: once arrived in Chrome 55, Firefox 50 and Safari 10; signal in Chrome 90, Firefox 86 and Safari 15. Default-passive touch listeners exist in Chrome 55, Firefox 61 and Safari 11.1; default-passive wheel listeners in Chrome 73 and Firefox 84, not Safari.