fix un proxy jank

This commit is contained in:
velzie 2024-07-30 14:16:17 -04:00
parent 98422f736d
commit 0fef6e8853
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
3 changed files with 18 additions and 13 deletions

View file

@ -1,5 +1,6 @@
import { iswindow } from "..";
import { ScramjetClient } from "../client";
import { unproxy } from "./unproxy";
const realOnEvent = Symbol.for("scramjet original onevent function");
@ -45,6 +46,7 @@ export default function (client: ScramjetClient, self: Self) {
client.Proxy("EventTarget.prototype.addEventListener", {
apply(ctx) {
unproxy(ctx, client);
if (typeof ctx.args[1] === "object")
ctx.args[1] = wraplistener(ctx.args[1]);
},