fix webpack patch on client using discordapp.com part 2

This commit is contained in:
Vendicated 2024-05-05 18:58:23 +02:00
parent 066b872219
commit ce18000c4e
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -121,9 +121,9 @@ Object.defineProperty(Function.prototype, "m", {
set(v: any) { set(v: any) {
// When using react devtools or other extensions, we may also catch their webpack here. // When using react devtools or other extensions, we may also catch their webpack here.
// This ensures we actually got the right one // This ensures we actually got the right one
const error = new Error(); const { stack } = new Error();
if (error.stack?.includes("discord.com")) { if (stack?.includes("discord.com") || stack?.includes("discordapp.com")) {
logger.info("Found Webpack module factory", error.stack.match(/\/assets\/(.+?\.js)/)?.[1] ?? ""); logger.info("Found Webpack module factory", stack.match(/\/assets\/(.+?\.js)/)?.[1] ?? "");
patchFactories(v); patchFactories(v);
} }