do some more worker rewriting

This commit is contained in:
Percs 2024-07-13 21:00:54 -05:00
parent a25e71a6fd
commit 4ce4226afa
4 changed files with 33 additions and 2 deletions

View file

@ -10,4 +10,22 @@ Worker = new Proxy(Worker, {
return Reflect.construct(target, argArray);
}
})
})
Worklet.prototype.addModule = new Proxy(Worklet.prototype.addModule, {
apply(target, thisArg, argArray) {
argArray[0] = encodeUrl(argArray[0])
return Reflect.apply(target, thisArg, argArray);
},
});
window.importScripts = new Proxy(window.importScripts, {
apply(target, thisArg, argArray) {
for (const i in argArray) {
argArray[i] = encodeUrl(argArray[i]);
}
return Reflect.apply(target, thisArg, argArray);
},
});