Score:0

open whatsapp links with web.whatsapp.com

cn flag

There is still no way to install a native Linux application for whatsapp, so I use allways use whatsapp's webapp with my daily browser (chromium based brave-browser).

Everything works (mostly) fine, except when I need to click on a whatsapp link in a web site, that is supposed to open a conversation with a certain new cell phone number. Here's an example on BOSE's site when you click in the button "message us".

When I click on a button like that one, I get redirected to api.whatsapp.com and then I get a popup prompt on my browser asking:

Open xdg-open?
https://api.whatsapp.com wants to open this application.

If I proceed, nothing happens.

I would expect to have a new whatsapp web tab opened to be able to message the new contact.

I have tried to use xdg-mime but I can't understand how to use it.

nobody avatar
gh flag
I found a snap https://snapcraft.io/whatsdesk and https://github.com/eneshecan/whatsapp-for-linux/releases
Score:5
jp flag

this worked for me, just register chrome as whatsapp handler, no need to disable javascript

xdg-mime default google-chrome.desktop 'x-scheme-handler/whatsapp'
code2be avatar
id flag
That worked for me.
JfredoJ avatar
pe flag
Does this also rely on the existance of a `.desktop` file (file with a *destkop* extension, as explained at https://wiki.archlinux.org/title/desktop_entries)?
Score:2
fk flag

You should be able to avoid the xdg popup by blocking JavaScript for api.whatsapp.com through site permissions. Since the webpage has a "continue to chat" link that redirects to web.whatsapp.com, assuming I understood the problem correctly, that link is the solution.

cn flag
Wow, that was surprisingly simple. After I blocked JavaScript, the popup was not shown after clicking on "message us". Instead, I was able to click on "continue to chat" in the following page, and web.whatsapp.com was loaded with the appropriate chat opened. Thank you!
Mike avatar
ph flag
Here are the steps to do this. Look for the three dots icon next to your avatar in the upper right corner, click on it and choose the _settings_ option. On the page that opens in the left menu, click _Privacy and security_. In the options that appear in the center, click _Site Settings_. At the bottom of the contents section, click _Javascript_. At the bottom, in the _Customized behaviors_ section, click the add button for the _Not allowed to use javascript_ option and type in the text box `api.whatsapp.com` and you're done.
jcubic avatar
ie flag
You don't need to block JavaScript. You can right-click on the link and pick open in a new tab or window.
Onkeltem avatar
tr flag
That's brilliant. It worked, many thanks Martin! I didn't know I can block JavaScript for websites.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.