13

I am trying to join a whatsapp group using desktop web whatsapp (chrome, ubuntu). When I click on Join Group, It shows dialogue below.I want to remove this dialogue forever from chrome. I can join the group by clicking again on join the group after dismissing the xdg-open dialogue.

I tried Reset chrome protocol_handler chrome with no luck.

I also tried to dismiss the dialogue using python selenium with no luck using below code.

               try:

                    WebDriverWait(browser, 3).until(EC.alert_is_present(),
                           'Timed out waiting for PA creation ' +
                           'confirmation popup to appear.')
                    #if it doe
                    alert = browser.switch_to.alert()
                    alert.accept()
                    print "alert accepted"
                except TimeoutException:
                    print "no alert"
                    pass

Is there a way to dismiss the dialogue using python selenium or using some configuration file changes in chrome installation ?

enter image description here

wizawu
  • 1,881
  • 21
  • 33
iamabhaykmr
  • 1,803
  • 3
  • 24
  • 49

3 Answers3

7

This solution works on Google Chrome 84.0.4147.89, for specific types of xdg links. For example, if the link in question is whatsapp://someurl, you can use:

sudo mkdir -p /etc/opt/chrome/policies/managed/ && echo '{ "URLWhitelist": ["whatsapp://*"] }' |sudo tee /etc/opt/chrome/policies/managed/whitelist.json
Eyal
  • 179
  • 1
  • 4
  • UPD: they renamed `URLWhitelist`/`whitelist.json` to `URLAllowlist`/`allowlist.json`, and the same for blacklist→blocklist. – cornholio Jul 28 '22 at 01:02
5

Here is the official documentation (https://support.google.com/chrome/a/answer/7532419) on how to do it.

@Eyal's answer is pretty close. Instead you should set the URLBlocklist field.

sudo mkdir -p /etc/opt/chrome/policies/managed
cd /etc/opt/chrome/policies/managed
jq -n '.URLBlocklist=["whatsapp://*"]' | sudo tee blocklist.json
wizawu
  • 1,881
  • 21
  • 33
  • “ssh” links are blocked - wtf? the question was "how to remove poup" without blocking app. – Sergey Nov 17 '22 at 11:41
0

This worked out for me... go to .local/share/applications/ create a file .. say whatsapp.desktop with the following info

[Desktop Entry]
Type=Application
Name=Whatsapp Scheme Handler
Exec=/opt/google/chrome/google-chrome %u
StartupNotify=false
MimeType=x-scheme-handler/whatsapp;

then registry the scheme handler with the following command

     xdg-mime default whatsapp.desktop x-scheme-handler/whatsapp
JuanD
  • 1