Skip to content

Fix 'prevent-addEventListener' - scriptlet throws error when 'null' is used as event type #539

@AdamWr

Description

@AdamWr

Steps to reproduce:

  1. Add to user rules:
adguard.com#%#//scriptlet('prevent-addEventListener', 'testEvent')
  1. Navigate to - https://adguard.com/
  2. Open console and run:
console.log('Start');
document.addEventListener(null, ()=>{});
console.log('End');

It should print Start and End.
Currently it prints Start only, because addEventListener throws error when null is used as a type.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions