I am trying to make a chrome extension that uses the WhatsApp API to share the link of the page I am at with just a click on the extension. The API is - https://wa.me/?text=urlencodedtext , where I provide the urlencodedtext.
the code I have written to perform this is - ( function(){ const YOUR_PHONE=''; window.open( https://api.whatsapp.com/send?phone=${YOUR_PHONE}&text=${encodeURIComponent(location.href)}
); } )();
The above code redirects me to the Whatsapp page. ScreenShot Being directed to the Whatsapp page make the process longer. Is there a way I can skip the Whatsapp page and go directly to the web whatsapp (or the desktop whatsapp).
I do not believe there is currently anyway to do this using that URL.
On Web, when you visit : https://api.whatsapp.com/send?phone=xxxxx&text=yyyy It will show an intermediate page with a "Send" button which would send via WhatsApp Web if you already have it configured.
However On Mobile, when you visit the same URL, it should load your WhatsApp App with the content , ready for you to press send.
For the extension you are trying to write, you would have to do the following:
I don't believe you can use the WhatsApp URL (it is not the API) you mentioned to achieve your purpose.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.