跨浏览器的自定义协议检测

Custom protocol detection across browsers

如何从浏览器检查是否安装了桌面应用程序,如果没有安装,用户将看到一个安装程序 link 如果没有,我们将只启动桌面应用程序,我们面临的挑战使用自定义协议处理程序概念来检测自定义 url 是否已注册,但这仅适用于 win8 上的 firefox 和 ie11。

在 chrome 上无法检测到存在的 proptocl 处理程序,基于 window 的模糊将无法工作 incase user checks the donot show window 选项,然后自定义 url 警报将不会显示,并且无法知道自定义 url 已注册。 win7 上的 ie11 也有同样的行为。 有人可以帮忙

我找到了,但一直没用过,这个:

https://github.com/ismailhabib/custom-protocol-detection

Custom Protocol Detection in Browser

Detect whether a custom protocol is available in browser (FF, Chrome, IE8, IE9, IE10, IE11, and Edge)

The implementation is different from one browser to another, sometimes depend on which OS you are. Most of them are hacks, meaning that the solution is not the prettiest.