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中从Azure BLOB存储中读取文件 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 包装空间模型 2022-01-01