从 IE 启动程序
是否可以从 IE 中的锚点启动程序?例如,iTunes 有类似 itms:blahblah 的链接,可以打开 iTunes 并直接转到相应的页面。如果是这样,最好的方法是什么?
Is it possible to launch a program from an anchor in IE? For example, iTunes had links like itms:blahblah that would open up iTunes and go directly to the appropriate page. If so, what is the best way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您纯粹从浏览器中进行对话,则无法注册自己的“协议”...问题是,当您安装 iTunes 时,它会注册
itms
协议,以便任何看起来的链接像这样:将打开 iTunes 应用程序。您不能这样做(如果不首先运行您自己的可执行文件,它会在计算机上注册您的自定义协议),但是,您可以做的是建立一个指向我们本地计算机上的文件的链接......示例:
当然,我假设您正在制作一个简单的 HTML 页面,供您自己的内部使用(或在您公司的内部网络上),以从您的计算机启动已知程序。
If you're talking purely from the browser, you can't register your own "protocol"... the thing is that when you installed iTunes, it registered the
itms
protocol so that any link that looks like this:Would open up the iTunes app. You can't do that (without running your own executable first which registers your custom protocol with the computer), but, what you can do is make a link to a file on our local computer... example:
I, of course, am assuming that you're making a simple HTML page that is meant for your own internal use (or on your companies internal network) to launch known programs from your computer.
是的,但并非没有帮助。您的协议必须在用户的计算机上注册,这可以通过 ftype。我假设您看到的是 iTunes 安装程序注册
itms
的产品。如果您在命令行中输入ftype itms
,您可能会得到类似itms=C:\Program Files\iTunes\iTunes.exe /url "%1"
的内容>。也就是说,不,你不能仅仅从浏览器内部做到这一点,那将是一个可怕的、可怕的、不好的、非常糟糕的安全漏洞。
Yes, but not without help. Your protocol has to be registered on the user's computer, which can be done via ftype. I'd assume that what you're seeing is the product of the iTunes installer registering
itms
. If you typeftype itms
at the command line, you're likely to get something likeitms=C:\Program Files\iTunes\iTunes.exe /url "%1"
.That is to say, no, you can't do it just from inside the browser, that would be a terrible, horrible, no-good, very-bad security hole.