mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
fix: do event proxying on workers
This commit is contained in:
parent
18f85c7860
commit
b15633fe8b
1 changed files with 3 additions and 7 deletions
|
@ -141,13 +141,8 @@ export default function (client: ScramjetClient, self: Self) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!iswindow) return;
|
const targets = [self.self, self.MessagePort.prototype] as Array<any>;
|
||||||
|
if (iswindow) targets.push(self.HTMLElement.prototype);
|
||||||
const targets = [
|
|
||||||
self.window,
|
|
||||||
self.HTMLElement.prototype,
|
|
||||||
self.MessagePort.prototype,
|
|
||||||
];
|
|
||||||
if (self.Worker) targets.push(self.Worker.prototype);
|
if (self.Worker) targets.push(self.Worker.prototype);
|
||||||
|
|
||||||
for (const target of targets) {
|
for (const target of targets) {
|
||||||
|
@ -159,6 +154,7 @@ export default function (client: ScramjetClient, self: Self) {
|
||||||
key.startsWith("on") &&
|
key.startsWith("on") &&
|
||||||
handlers[key.slice(2)]
|
handlers[key.slice(2)]
|
||||||
) {
|
) {
|
||||||
|
console.log(key);
|
||||||
const descriptor = nativeGetOwnPropertyDescriptor(target, key);
|
const descriptor = nativeGetOwnPropertyDescriptor(target, key);
|
||||||
if (!descriptor.get || !descriptor.set || !descriptor.configurable)
|
if (!descriptor.get || !descriptor.set || !descriptor.configurable)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue