如何从安装程序向 Firefox 和 Internet Explorer 添加 MIME 处理程序

发布于 2024-09-05 09:25:48 字数 189 浏览 6 评论 0原文

我正在创建一个安装程序,为 Firefox 和 Explorer 中的 MIME 类型添加处理程序。我将使用的安装程序是 INNO(又名 Oh Nooo!)或 NSIS。

Mozilla 和 Microsoft 建议如何添加处理程序。到目前为止,我所能找到的 Firefox 就是如何手动添加/删除/增强,无论多么简单,我都想对用户隐藏一些东西。

I'm looking to create an installer that will add a handler for a MIME type in Firefox and Explorer. The installer I will be using will be either INNO (a.k.a Oh Nooo!) or NSIS.

How do Mozilla and Microsoft recommend adding a handler. So far all I have been able to find for Firefox is how to Add/Remove/Augment manually which no matter how simple is something I would like to hide from the user.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你怎么敢 2024-09-12 09:25:48

对于 NSIS,要将您的应用程序注册为给定 MIME 类型的默认应用程序,您可以:

  1. 手动在中写入新密钥注册表显示的方式此处(使用 MIMEAssociations 子项)
  2. 使用 应用程序关联注册 插件

如果正确注册了 mime 类型,我认为您不会有任何问题。

此处解释了 Firefox 如何处理 MIME/文件映射。

For NSIS, to register your application as default for a given MIME type, you can either :

  1. manually write new keys in the registry the way it is shown here (using the MIMEAssociations subkey)
  2. use the Application Association Registration plug-in

If the mime-type is correctly registered, I don't think you'll have any problem.

There's an explanation here on how Firefox handles MIME / file mapping.

七分※倦醒 2024-09-12 09:25:48

这对我有用 启动注册的 mime 帮助程序应用程序

但如果你想要那个 firefox打开处理程序而不询问任何内容(例如,当您检查“始终执行此操作”或它是如何调用时),您可能不得不弄乱 mimeTypes.xml。请参阅 http://www.math.ubc.ca/MathNet /FAQ/index.shtml?FirefoxHelper.html

this worked for me Launching a registered mime helper application

but if you want that firefox opens the handler without asking anything (like when you check the "do this always" or how is it called), you'll probably have to mess with mimeTypes.xml. see http://www.math.ubc.ca/MathNet/FAQ/index.shtml?FirefoxHelper.html

醉城メ夜风 2024-09-12 09:25:48

在 FirefoxQuantum 中,MIME 处理程序位于 Firefox 配置文件目录中名为 handlers.json 的文件中。在 Windows 上,该目录位于 %APPDATA%\Mozilla\Firefox\Profiles ,通常会扩展到 C:\Users\yourname\AppData\Roaming\Mozilla\Firefox\Profiles >

默认配置文件目录的名称具有随机字母数字名称,扩展名为 .default,例如 v3c92uhd.default

如果编辑 handlers.json 文件,请确保将其保存为 json 压缩形式和 UTF8 编码,否则 Firefox 将拒绝读取它。

In firefox quantum the mime handlers are in a file called handlers.json in your firefox profile directory. On windows that directory is located in %APPDATA%\Mozilla\Firefox\Profiles , which typically expands to C:\Users\yourname\AppData\Roaming\Mozilla\Firefox\Profiles

The name of the default profile directory has random alphanumeric name with a .default extension, e.g. v3c92uhd.default

If you edit the handlers.json file, make sure to save it in json compressed form and UTF8 encoding, otherwise firefox will refuse to read it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文