Webwhatsapp-wrapper: webpackJsonp is not defined

Created on 25 Feb 2021  路  7Comments  路  Source: mukulhase/WebWhatsapp-Wrapper

Most helpful comment

Confirm Working :)
for convenience the lines to copy are from
lines 30 to 86 of wapi.js

```
for (let idx in modules) {
if ((typeof modules[idx] === "object") && (modules[idx] !== null)) {
neededObjects.forEach((needObj) => {
if (!needObj.conditions || needObj.foundedModule)
return;
let neededModule = needObj.conditions(modules[idx]);
if (neededModule !== null) {
foundCount++;
needObj.foundedModule = neededModule;
}
});

            if (foundCount == neededObjects.length) {
                break;
            }
        }
    }

    let neededStore = neededObjects.find((needObj) => needObj.id === "Store");
    window.Store = neededStore.foundedModule ? neededStore.foundedModule : {};
    neededObjects.splice(neededObjects.indexOf(neededStore), 1);
    neededObjects.forEach((needObj) => {
        if (needObj.foundedModule) {
            window.Store[needObj.id] = needObj.foundedModule;
        }
    });

    window.Store.Chat.modelClass.prototype.sendMessage = function (e) {
        window.Store.SendTextMsgToChat(this, ...arguments);
    }       

    return window.Store;
}

    if (typeof webpackJsonp === 'function') {
        webpackJsonp([], {'parasite': (x, y, z) => getStore(z)}, ['parasite']);
    } else {
        let tag = new Date().getTime();
        webpackChunkbuild.push([
            ["parasite" + tag],
            {

            },
            function (o, e, t) {
                let modules = [];
                for (let idx in o.m) {
                    let module = o(idx);
                    modules.push(module);
                }
                getStore(modules);
            }
        ]);
    }

})();

}

```

from 1003 https://github.com/mukulhase/WebWhatsapp-Wrapper/blob/6eae48b8f6e69c6564ce2ab2eec0b12c5876dd94/webwhatsapi/js/wapi.js

All 7 comments

same issue here

same issue, looking for solution

@efjcz thanks men. it's working

Confirm Working :)
for convenience the lines to copy are from
lines 30 to 86 of wapi.js

```
for (let idx in modules) {
if ((typeof modules[idx] === "object") && (modules[idx] !== null)) {
neededObjects.forEach((needObj) => {
if (!needObj.conditions || needObj.foundedModule)
return;
let neededModule = needObj.conditions(modules[idx]);
if (neededModule !== null) {
foundCount++;
needObj.foundedModule = neededModule;
}
});

            if (foundCount == neededObjects.length) {
                break;
            }
        }
    }

    let neededStore = neededObjects.find((needObj) => needObj.id === "Store");
    window.Store = neededStore.foundedModule ? neededStore.foundedModule : {};
    neededObjects.splice(neededObjects.indexOf(neededStore), 1);
    neededObjects.forEach((needObj) => {
        if (needObj.foundedModule) {
            window.Store[needObj.id] = needObj.foundedModule;
        }
    });

    window.Store.Chat.modelClass.prototype.sendMessage = function (e) {
        window.Store.SendTextMsgToChat(this, ...arguments);
    }       

    return window.Store;
}

    if (typeof webpackJsonp === 'function') {
        webpackJsonp([], {'parasite': (x, y, z) => getStore(z)}, ['parasite']);
    } else {
        let tag = new Date().getTime();
        webpackChunkbuild.push([
            ["parasite" + tag],
            {

            },
            function (o, e, t) {
                let modules = [];
                for (let idx in o.m) {
                    let module = o(idx);
                    modules.push(module);
                }
                getStore(modules);
            }
        ]);
    }

})();

}

```

from 1003 https://github.com/mukulhase/WebWhatsapp-Wrapper/blob/6eae48b8f6e69c6564ce2ab2eec0b12c5876dd94/webwhatsapi/js/wapi.js

'modelClass' of undefined

'modelClass' of undefined

There is another pullrequest that replaces the code block:

window.Store.Chat.modelClass.prototype.sendMessage = function (e) {
    window.Store.SendTextMsgToChat(this, ...arguments);
}

for

window.Store.ChatClass.default.prototype.sendMessage = function (e) {
    window.Store.SendTextMsgToChat(this, ...arguments);
}

Even so, I didn't manage to put the whole thing back to work.... =/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EdisonHundLucas picture EdisonHundLucas  路  6Comments

wallysonn picture wallysonn  路  3Comments

NolanWang picture NolanWang  路  5Comments

smileman03 picture smileman03  路  5Comments

dafner picture dafner  路  6Comments