How to prevent popping-up xdg-open dialogue from Ubuntu chrome while opening specific link?(如何防止在打开特定链接时从 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 对话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何防止在打开特定链接时从 Ubuntu chrome 弹出 xdg-open 对话?


- 计算测试数量的Python单元测试 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01