如何检测浏览器的协议处理程序?

如何检测浏览器的协议处理程序?

问题描述:

我创建一个自定义URL协议处理程序。

I have created a custom URL protocol handler.

的http://

至mailto://

自定义的://

custom://

我已经注册了一个WinForms应用程序作出相应的反应。这一切的伟大工程。

I have registered a WinForms application to respond accordingly. This all works great.

不过,我想能够正常处理的情况下,用户没有安装自定义URL协议处理程序,但。

But I would like to be able to gracefully handle the case where the user doesn't have the custom URL protocol handler installed, yet.

在为了能够做到这一点,我需要能够检测浏览器的注册协议处理程序,我会从JavaScript承担。但我一直无法找到一个方法来轮询的信息。我希望能找到解决这个问题。

In order to be able to do this I need to be able to detect the browser's registered protocol handlers, I would assume from JavaScript. But I have been unable to find a way to poll for the information. I am hoping to find a solution to this problem.

谢谢你也许可以分享任何想法。

Thanks for any ideas you might be able to share.

这将是一个的非常非常 哈克办法做到这一点......但将这项工作?

This would be a very, very hacky way to do this... but would this work?


  • 把链接正常...

  • 但是附加一个onclick处理它,它设置一个计时器,并增加了一个的onblur处理程序窗口

  • (在理论上),如果浏览器处理的联系(应用Ⅹ)将加载从窗口偷的焦点...

  • 如果onblur事件触发,清除定时器...

  • 否则,请在3-5seconds让你超时火...并通知用户嗯,看来你没有安装超级超级酷的应用做...你想现在安装?(OK)(取消)

远离防弹...但它可能会帮助?

Far from bulletproof... but it might help?