Chrome 政策“ExternalProtocolDialogShowAlwaysOpenCheckbox”不起作用

问题描述

我正在使用库 https://github.com/aik099/PhpStormProtocol/ 从浏览器 (Chrome) 获取指向我的 IDE (PHPStorm) 的链接。每次 xdebug 打印警告时,它都会附加一个带有 href 的链接,如下所示:

PHPstorm://open?file={filepath}&line={line}

xdebug_link

这很完美。问题是每次我点击链接时都会弹出这样的窗口:

popup

我已尝试按照此处找到的步骤操作: https://superuser.com/questions/1481851/disable-chrome-to-ask-for-confirmation-to-open-external-application-everytime

在 Windows 寄存器中启用该 policy 并在我的浏览器中对其进行验证后,我仍然有相同的弹出窗口,但没有选中永久允许此协议的复选框。

enter image description here

解决方法

问题是,您想通过“http”连接打开 url 处理程序。

但是如果您有“https”连接,您只会得到正方形。

如果你设置一个规则,你的“http”连接是可信的,你就可以解决你的问题。

对于 chrome,在地址栏中写入“chrome://flags/”并将您的 url 写入选项“不安全的来源被视为安全”并将其设置为启用。

enter image description here

,

External​Protocol​Dialog​Show​Always​Open​Checkbox 仅适用于 https 网站。

您可以改为将协议 phpstorm://* 添加到 Chrome 的 URLAllowlist,例如通过 Windows 注册表:

Windows registry

用户根本看不到弹出窗口,软件会自动打开。