don't override non event properties on window

This commit is contained in:
velzie 2024-07-30 13:19:33 -04:00
parent c0c3dd1f0d
commit 98422f736d
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -38,7 +38,7 @@ export default function (client: ScramjetClient, self: Self) {
}
}
return listener.apply(self, argArray);
return Reflect.apply(target, thisArg, argArray);
},
});
}
@ -60,7 +60,11 @@ export default function (client: ScramjetClient, self: Self) {
const keys = Reflect.ownKeys(target);
for (const key of keys) {
if (typeof key === "string" && key.startsWith("on")) {
if (
typeof key === "string" &&
key.startsWith("on") &&
handlers[key.slice(2)]
) {
const descriptor = Object.getOwnPropertyDescriptor(target, key);
if (!descriptor.get || !descriptor.set || !descriptor.configurable)
continue;