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 对话?
基础教程推荐
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 筛选NumPy数组 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01