alfred82santa / whalesong

Whalesong is an asyncio python library to manage WebApps remotely. Currently WhatsappWeb is implemented
https://whalesong.readthedocs.io
MIT License
50 stars 19 forks source link

WARNING Message: TypeError: window.manager is undefined whatsapp web #106

Closed edwinalex035 closed 5 years ago

edwinalex035 commented 5 years ago

Hi,

I have been using whalesong for a while and today, whatsapp web install a new update. After that, the code gave me this warning: WARNING Message: TypeError: window.manager is undefined whatsapp web Then I tried to run it again and it is giving the following exception:

Traceback (most recent call last): File "/home/alexander/PycharmProjects/wappExt/silsol_multimedia.py", line 737, in bot.loop.run_until_complete(bot.start()) File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete return future.result() File "/home/alexander/PycharmProjects/wappExt/silsol_multimedia.py", line 703, in start await self._driver.start() File "/home/alexander/PycharmProjects/wappExt/venv/lib/python3.6/site-packages/whalesong/init.py", line 96, in start await self._driver.connect() File "/home/alexander/PycharmProjects/wappExt/venv/lib/python3.6/site-packages/whalesong/driver_firefox.py", line 108, in connect await self.run_scriptlet() File "/home/alexander/PycharmProjects/wappExt/venv/lib/python3.6/site-packages/whalesong/driver.py", line 69, in run_scriptlet await self._internal_run_scriptlet(script.read()) File "/home/alexander/PycharmProjects/wappExt/venv/lib/python3.6/site-packages/whalesong/driver_firefox.py", line 119, in _internal_run_scriptlet await self._run_async(self.driver.execute_script, script) File "/home/alexander/PycharmProjects/wappExt/venv/lib/python3.6/site-packages/whalesong/driver_firefox.py", line 73, in _run_async return await self.loop.run_in_executor(self._pool_executor, partial(method, *args, *kwargs)) File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(self.args, **self.kwargs) File "/home/alexander/PycharmProjects/wappExt/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 636, in execute_script 'args': converted_args})['value'] File "/home/alexander/PycharmProjects/wappExt/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/home/alexander/PycharmProjects/wappExt/venv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: TypeError: e[o] is undefined

Tingaev commented 5 years ago

alfred82santa hi, can I help you?

alfred82santa commented 5 years ago

Could you test the branch bug/new-webpackjsonp?

$ make build-js
$ PYTHONPATH=.:$PYTHONPATH python examples/minibot-chromium.py 
maurissao commented 5 years ago

Hi, the fix works to find the modules properly, but i think there are some other changes to do. Sending message throw that error: 'sendMessage (send_fn()): TypeError: n.model.sendMessage is not a function'

alfred82santa commented 5 years ago

You are right, sendMessage function has been disappeared... I'm looking for an alternative.

maurissao commented 5 years ago

I have added this artifacts: 'chatClass': (module) => (module.default && module.default.prototype && module.default.prototype.Collection !== undefined && module.default.prototype.Collection === "Chat") ? module : null, 'sendTextMsgToChat': (module) => (module.sendTextMsgToChat) ? module.sendTextMsgToChat : null, and changed the constructor for chat manager: ` this.chatClass = chatClass;

this.chatClass.default.prototype.sendMessage = function(e) {
    return sendTextMsgToChat(this, ...arguments)
}

` i'm still testing but now it's able to send message, i'm using the Jabolina fork, my code is a little different. I think you can make a better fix than me. thanks.

victorriba commented 5 years ago

hello, any solution??

maurissao commented 5 years ago

108

alfred82santa commented 5 years ago

I've released a new version with some fixes in order to adapt to new whatsapp code. It is possible new bugs appear. Please open an issue for each one you find.