1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Harden addEventListener scriptlet

This commit is contained in:
Raymond Hill 2023-05-28 14:56:31 -04:00
parent c7ddb2501b
commit 3ee3275dc1
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -882,7 +882,13 @@ function addEventListenerDefuser(
}
if ( matchesBoth ) { return; }
return Reflect.apply(target, thisArg, args);
}
},
get(target, prop, receiver) {
if ( prop === 'toString' ) {
return target.toString.bind(target);
}
return Reflect.get(target, prop, receiver);
},
};
self.EventTarget.prototype.addEventListener = new Proxy(
self.EventTarget.prototype.addEventListener,