Open file link with application on user click [duplicate]

守給你的承諾、 提交于 2019-12-25 03:08:49

问题


In my website i have a link to kml file .

When a user clicks on this link ,I want to open this kml file with google earth application.

In android we can do it by using intent and providing content type.

How to do the same is desktop ? NO But it will not solve the problem.

Is there way to ask for user consent if yes open using script? Can i run any client side script to do this.


回答1:


As mentioned on the answer you have linked to:

You generally can't run arbitrary program on the client machine from a web page. With or without consent. You can only do this by installing a browser plug-in after the user consent or otherwise asking the user for actions.
Allowing this will be a security hazard.

You can use standard web page actions. But then the result can depend on client side user configuration.

It is also mention in the linked answer that you can use the web base Google Earth. And of course you can use some simple client side script to ask confirmation for that if you still like to.



来源:https://stackoverflow.com/questions/16342733/open-file-link-with-application-on-user-click

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