Merge branch 'dev' into modules-proxy-patches
This commit is contained in:
commit
28a7fbb309
|
@ -78,8 +78,7 @@ export default definePlugin({
|
||||||
// Because of that, its WebpackInstance doesnt export wreq.m or wreq.c
|
// Because of that, its WebpackInstance doesnt export wreq.m or wreq.c
|
||||||
|
|
||||||
// To circuvent this and disable Sentry we are gonna hook when wreq.g of its WebpackInstance is set.
|
// To circuvent this and disable Sentry we are gonna hook when wreq.g of its WebpackInstance is set.
|
||||||
// When that happens we are gonna obtain a reference to its internal module cache (wreq.c) and proxy its prototype,
|
// When that happens we are gonna forcefully throw an error and abort everything.
|
||||||
// so, when the first require to initialize the Sentry is attempted, we are gonna forcefully throw an error and abort everything.
|
|
||||||
Object.defineProperty(Function.prototype, "g", {
|
Object.defineProperty(Function.prototype, "g", {
|
||||||
configurable: true,
|
configurable: true,
|
||||||
|
|
||||||
|
@ -112,28 +111,12 @@ export default definePlugin({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cacheExtractSym = Symbol("vencord.cacheExtract");
|
new Logger("NoTrack", "#8caaee").info("Disabling Sentry by erroring its WebpackInstance");
|
||||||
Object.defineProperty(Object.prototype, cacheExtractSym, {
|
|
||||||
configurable: true,
|
|
||||||
|
|
||||||
get(this: WebpackRequire["c"]) {
|
|
||||||
new Logger("NoTrack", "#8caaee").info("Disabling Sentry by proxying its WebpackInstance cache");
|
|
||||||
Object.setPrototypeOf(this, new Proxy(this, {
|
|
||||||
get() {
|
|
||||||
throw new Error("Sentry successfully disabled");
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
Reflect.deleteProperty(Function.prototype, "g");
|
Reflect.deleteProperty(Function.prototype, "g");
|
||||||
Reflect.deleteProperty(Object.prototype, cacheExtractSym);
|
|
||||||
Reflect.deleteProperty(window, "DiscordSentry");
|
Reflect.deleteProperty(window, "DiscordSentry");
|
||||||
|
|
||||||
return { exports: {} };
|
throw new Error("Sentry successfully disabled");
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// WebpackRequire our fake module id
|
|
||||||
this(cacheExtractSym);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue