fix: syncxhr and dynamic import function

This commit is contained in:
Percs 2024-11-02 21:10:58 -05:00
parent 7de29b7cf3
commit 3981e40deb
2 changed files with 4 additions and 2 deletions

View file

@ -5,7 +5,9 @@ import { ScramjetClient } from "../../client";
export default function (client: ScramjetClient, self: Self) {
let worker;
if (self.Worker && flagEnabled("syncxhr", client.url)) {
worker = new client.natives["Worker"](config.files.sync);
worker = new (client.natives["Worker"] ? client.natives["Worker"] : Worker)(
config.files.sync
);
}
const ARGS = Symbol("xhr original args");
const HEADERS = Symbol("xhr headers");