Skip to content

Commit

Permalink
fix: Fixed buttons rendering on WhatsApp WEB >= 2.2234.6
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Sep 17, 2022
1 parent bcc135f commit 49e8311
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/chat/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,23 @@ function applyPatch() {
return func(...args);
});
}

declare global {
interface Window {
stylex: any;
}
}
/**
* Fix for buttons for @whatsapp >= 2.2234.6
* This is an erro in whatsapp javascript files
*/
webpack.onInjected(() => {
if ('stylex' in window) {
return;
}
const stylexModule = webpack.search((m) => m.default.dedupe);
if (!stylexModule?.default) {
return;
}
window.stylex = stylexModule?.default;
});

0 comments on commit 49e8311

Please sign in to comment.