如何将自定义 MIME 类型关联到主要浏览器中的本地应用程序?
我想发明一种新的 mime 类型并将其与浏览器中的自定义应用程序相关联,以使用户能够从网页启动我的应用程序。我的安全网站的用户处于封闭环境中,这意味着这不是通用的主流应用程序 - 我可以提前配置他们的浏览器。
Spoon.net 做了一些非常类似的事情,可以使用其迷你内核插件启动虚拟化应用程序。
此问题的答案之一< /a> 提到了这种方法,但没有详细说明如何完成它。
如何在 Chrome 和 IE 8/9 上以跨平台方式实现此目的?有没有办法通过浏览器扩展(本机扩展或通过 crossrider 进行 mime 类型关联?像 Adobe Reader 或 Apple Quicktime 这样的应用程序如何实现这一目标?如果可能的话,我想避免接触注册表。
这种方法有哪些风险?我的网站是一个使用证书保护并受到用户信任的 Intranet Web 应用程序。我有什么理由不应该走这条路?
编辑:显然,这可以在 Firefox 中通过操作 mimeTypes.rdf 文件< /a>.
编辑:它看起来像JDIC是一种基于 Java 的机制,可以用于同样的事情。是否有类似的非 Java 构造?也许在 JavaScript 中?
I want to invent a new mime-type and associate it to a custom application in the browser to enable users to launch my app from a web page. The users of my secure web site are in a closed-environment, meaning this is not a general-purpose, mainstream application - I can configure their browser ahead of time.
Spoon.net does something very similar to enable launching virtualized applications using their mini-kernel plugin.
One of the answers to this question alluded to this method, without details for how to accomplish it.
How do I achieve this in a cross-platform manner on Chrome and IE 8/9? Is there a way to do the mime-type association through browser extensions, either native or through crossrider? How does an app like Adobe Reader or Apple Quicktime achieve this? I want to avoid touching the registry if possible.
What are the risks associated with this method? My site is an intranet web application secured with a certificate and trusted by my users. Any reason I should not go down this path?
EDIT: Apparently this can be achieved in Firefox by manipulating the mimeTypes.rdf file.
EDIT: It looks like JDIC is a Java-based mechanism that could be used for the same thing. Is there a similar non-Java construct? Maybe in Javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来可以通过Windows 上的注册表更改来完成。
Windows 上的进一步阅读...
这里是 如何在 Linux 上执行此操作。
It looks like it can be done via a registry change on windows.
Further reading on Windows...
And here's how to do so on Linux.
我经常想将新文件类型与文本文件关联起来。最安全、最快捷的方法是:
A. 如果该文件类型尚不存在,则在注册表中创建该文件类型
B. 将文件类型与默认程序关联
新文件类型应使用您选择的默认文本编辑器程序在 Windows 资源管理器中打开和预览。
I often want to associate a new file type with being a text file. The safest and quickest way of doing this is:
A. Create the file type in Registry if it doesn't already exist
B. Associate the file type with a default program
The new file type should open and preview in Windows Explorer with the default text editor program you selected.