打开特定链接时如何防止Ubuntu chrome弹出xdg-open对话框? [英] How to prevent popping-up xdg-open dialogue from Ubuntu chrome while opening specific link?

查看:169
本文介绍了打开特定链接时如何防止Ubuntu chrome弹出xdg-open对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用桌面网络whatsapp(chrome,ubuntu)加入whatsapp组.当我单击加入组"时,它将在下面显示对话框.我想从chrome中永久删除此对话框.在关闭xdg-open对话框后,我可以通过再次单击加入组来加入该组.

我尝试了

解决方案

该解决方案适用于Google Chrome 84.0.4147.89,适用于特定类型的xdg链接.例如,如果有问题的链接是 whatsapp://someurl ,则可以使用:

  sudo mkdir -p/etc/opt/chrome/policies/managed/&&echo'{" URLWhitelist" ;: [" whatsapp://*"]}'| sudo tee/etc/opt/chrome/policies/managed/whitelist.json 

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 ?

解决方案

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

这篇关于打开特定链接时如何防止Ubuntu chrome弹出xdg-open对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆