Approaches of detection of custom protocol in chrome and Safari browsers

一世执手 提交于 2019-12-24 16:06:11

问题


What could be the best way the detecting the custom protocol (like foo://) in Safari and chrome browser. I was looking at the following options:

  1. Browser extension which can check the existence of custom protocol invoker software. (Not sure if it is possible and how to do it)

  2. Browser plugin or java applets( since NPAPI is now going to deprecated so probably this will not be good idea).

  3. Flash Action script with java script(since Flash is sand boxed then again it seems not good idea to use it)

Can any one suggest any other approach or suggestion? can I go by approach #1.


回答1:


You should be able to detect the custom protocol by relying only on Javascript.

I've found the following project for protocol detection using Javascript, hope it helps: https://gist.github.com/rajeshsegu/3716941

You can check more information in this related question: How to detect browser's protocol handlers?



来源:https://stackoverflow.com/questions/27489665/approaches-of-detection-of-custom-protocol-in-chrome-and-safari-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!