fix: incorrectly classified xhr requests as sync

This commit is contained in:
Percs 2024-11-16 23:08:39 -06:00
parent 9398cf78be
commit a3a8eba0ec

View file

@ -15,6 +15,7 @@ export default function (client: ScramjetClient, self: Self) {
client.Proxy("XMLHttpRequest.prototype.open", { client.Proxy("XMLHttpRequest.prototype.open", {
apply(ctx) { apply(ctx) {
if (ctx.args[1]) ctx.args[1] = rewriteUrl(ctx.args[1], client.meta); if (ctx.args[1]) ctx.args[1] = rewriteUrl(ctx.args[1], client.meta);
if (ctx.args[2] === undefined) ctx.args[2] = true;
ctx.this[ARGS] = ctx.args; ctx.this[ARGS] = ctx.args;
}, },
}); });