From 066b872219e247bf6624d07386ada0791c336dbb Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 5 May 2024 18:56:49 +0200 Subject: [PATCH] fix webpack patch on client using discordapp.com --- src/webpack/patchWebpack.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index d2b569e8d..8dd3dba8b 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -63,7 +63,8 @@ Object.defineProperty(Function.prototype, "O", { // When using react devtools or other extensions, or even when discord loads the sentry, we may also catch their webpack here. // This ensures we actually got the right one // this.e (wreq.e) is the method for loading a chunk, and only the main webpack has it - if (new Error().stack?.includes("discord.com") && String(this.e).includes("Promise.all")) { + const { stack } = new Error(); + if ((stack?.includes("discord.com") || stack?.includes("discordapp.com")) && String(this.e).includes("Promise.all")) { logger.info("Found main WebpackRequire.onChunksLoaded"); delete (Function.prototype as any).O;