WhatsApp direct chat bookmarklet

January 10, 2024

Another day, another pain point that could be solved with a little enchant. On the web, sometimes people publishes or handles you their whatsapp number. But to talk, you have to add them as a contact.

Few knows that whatsapp provides a url you can use to chat directly. Its nothing more than https://wa.me/1XXXXXXXXXX

So lets write something to make that link with the currently selected text.

As always, here is the javascript code if you want to run it in your devtools

const sel = window.getSelection().toString().replaceAll(/[^0-9\.]+/g, ""); sel !== "" && window.open(`https://wa.me/${sel}`, "_blank");

Another option is to add this WSP Chat bookmarklet to your bookmarks and just click it.

Leave your comment on the github issue, sending me an email or DMing me on twitter