mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
do some more worker rewriting
This commit is contained in:
parent
a25e71a6fd
commit
4ce4226afa
4 changed files with 33 additions and 2 deletions
|
@ -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);
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue