From ce18000c4e403d2408ecf882568ffea90442336d Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 5 May 2024 18:58:23 +0200 Subject: [PATCH] fix webpack patch on client using discordapp.com part 2 --- src/webpack/patchWebpack.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 8dd3dba8b..d3de20727 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -121,9 +121,9 @@ Object.defineProperty(Function.prototype, "m", { set(v: any) { // When using react devtools or other extensions, we may also catch their webpack here. // This ensures we actually got the right one - const error = new Error(); - if (error.stack?.includes("discord.com")) { - logger.info("Found Webpack module factory", error.stack.match(/\/assets\/(.+?\.js)/)?.[1] ?? ""); + const { stack } = new Error(); + if (stack?.includes("discord.com") || stack?.includes("discordapp.com")) { + logger.info("Found Webpack module factory", stack.match(/\/assets\/(.+?\.js)/)?.[1] ?? ""); patchFactories(v); }