prevent-listener
The prevent-listener snippet prevents the addition of event listeners by wrapping EventTarget.prototype.addEventListener.
Parameters
|
Name |
Description |
Mandatory |
|---|---|---|
|
type |
A pattern that matches the type(s) of events to prevent. Enclose in |
Yes |
|
handler |
A pattern that matches the event handler's declaration. Enclose in |
No |
|
selector |
The CSS selector that the event target must match. |
No |
Filter examples
|
Filter |
Result |
|---|---|
|
|
No event listener will be added for click events. |
|
|
No click event listener added on div elements whose handler matches "console". |
|
|
No listener added for click events whose handler matches "console". |
Debugging
|
Message |
When |
Definition |
|---|---|---|
|
|
After wrapping |
|
|
|
Each time prevented |
Detailed group of logs about the event type and handler. |