From b15633fe8bd5409aa0ca59308e3c23818a3d599e Mon Sep 17 00:00:00 2001 From: Percs <83934299+Percslol@users.noreply.github.com> Date: Sat, 12 Oct 2024 03:11:44 -0500 Subject: [PATCH] fix: do event proxying on workers --- src/client/shared/event.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/client/shared/event.ts b/src/client/shared/event.ts index 6a9dfbe..59147c3 100644 --- a/src/client/shared/event.ts +++ b/src/client/shared/event.ts @@ -141,13 +141,8 @@ export default function (client: ScramjetClient, self: Self) { }, }); - if (!iswindow) return; - - const targets = [ - self.window, - self.HTMLElement.prototype, - self.MessagePort.prototype, - ]; + const targets = [self.self, self.MessagePort.prototype] as Array; + if (iswindow) targets.push(self.HTMLElement.prototype); if (self.Worker) targets.push(self.Worker.prototype); for (const target of targets) { @@ -159,6 +154,7 @@ export default function (client: ScramjetClient, self: Self) { key.startsWith("on") && handlers[key.slice(2)] ) { + console.log(key); const descriptor = nativeGetOwnPropertyDescriptor(target, key); if (!descriptor.get || !descriptor.set || !descriptor.configurable) continue;