fix(adblocker/inplayer): fix Response.prototype.json

fix #2310
This commit is contained in:
JellyBrick
2024-08-04 14:36:10 +09:00
parent ff0c5b87c9
commit 7656c41dbc
2 changed files with 16 additions and 15 deletions

View File

@ -37,19 +37,9 @@ export const inject = (contextBridge) => {
//
return o;
};
}
contextBridge.exposeInMainWorld('_proxyJsonParse', new Proxy(JSON.parse, {
apply() {
return pruner(Reflect.apply(...arguments));
},
}));
contextBridge.exposeInMainWorld('_proxyResponseJson', new Proxy(Response.prototype.json, {
apply() {
return Reflect.apply(...arguments).then((o) => pruner(o));
},
}));
contextBridge.exposeInMainWorld('_pruner', pruner);
}
const chains = [