Skip to content

Commit

Permalink
fix: Fixed compatibility with WhatsApp >= 2.2325.3
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jun 13, 2023
1 parent be12ac6 commit 5339618
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/webpack/index.ts
Expand Up @@ -75,8 +75,11 @@ export function injectLoader(): void {

const chunkName = 'webpackChunkwhatsapp_web_client';

const self = window as any;
const chunk = (self[chunkName] = self[chunkName] || []);
const global = (self || window) as any;
const chunk = global[chunkName] || [];
if (typeof global[chunkName] === 'undefined') {
global[chunkName] = chunk;
}

const injectFunction = async (__webpack_require__: any) => {
webpackRequire = __webpack_require__;
Expand Down

0 comments on commit 5339618

Please sign in to comment.