mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.03k stars 797 forks source link

How injection of wapi.js works? #939

Open avilabss opened 4 years ago

avilabss commented 4 years ago

I really found this cool and wish to know what exactly is happening and how can I say replicate this on other websites who don't have any official APIs.

erm3nda commented 3 years ago

As far as I readed, wapi.js is injected vía regular driver.execute_script(), then you can access WAPI javascript class for interacting. The same than when you want to inject JQuery.

avilabss commented 3 years ago

No, I'm asking about the first 100 lines of the WAPI.js file where he is injecting the "WAPI" object into "window" by using "parasite" into "webpackjsonp" which contains all the necessary methods to drive the whole frontend. I'm interested in knowing the working of that.