跳到主要内容
Content-Type Fixer

Content-Type Fixer EN

jscher2000 · Firefox

Firefox doesn't follow instructions for downloads? "Always Open Similar Files" is missing? This usually happens because the server sent Firefox a wrong/generic Content-Type header, or forces a download with Content-Disposition. Here's a fix.

4.7/5 45 人评分 1.7千用户 v1.7.5当前版本
权限提示 该扩展申请访问所有网站(<all_urls>),意味着它可以读取你在任意站点的页面内容,包括已登录的页面。这是许多扩展正常工作的必要条件,但也值得你确认来源可信。

截图

  • Content-Type Fixer 截图
  • Content-Type Fixer 截图
  • Content-Type Fixer 截图
  • Content-Type Fixer 截图

简介

You can find a new help page (for Firefox 98+) here: https://www.jeffersonscher.com/ext/content-type-fixer.html

Operation

This extension does not monitor downloads until you enable it. Use the toolbar button to turn listening on (shows a yellow burst) and off (shows Zzzz). (If you want it on automatically, there is a checkbox on the menu for that.)

Content-Type

The extension checks the file extension on new page and download requests to see whether they have a file extension that should be assigned a specific Content-Type header. (It doesn't look at requests for embedded items like images, audio, or video.)

Automatically corrects the Content-Type for these extensions: .acsm, .css, .csv, .doc/docx, .epub, .pdf, .ppt/pptx, .psd, .rar, .rtf, .xls/xlsx, .zip, and .7z. Some image and video formats can be enabled with a click.

To add more, turn on the extension, try to download a file that isn't being handled correctly, then open the Log of recent requests to find Add and Edit buttons to add a custom Content-Type. The log is not saved to disk and is flushed when you snooze the extension.

Content-Disposition

The extension corrects errors with spaces that cause download file names to cut off. You can optionally force inline disposition, so Firefox follows the rules you've set on the Options/Preferences page without showing the download dialog each time. You also can force attachment disposition to bypass viewing in a tab. I suggest using that option sparingly, only as needed.

Exception Notes

Version 1.7.1+ ignores "Follow my settings (inline)" on Google Drive and for Gmail attachments due to cookie issues. Version 1.7.2+ extends the exception to Google Docs.

Permissions Note

While the extension is listening, it reads the Content-Type and Content-Disposition headers that servers send with files. It may modify the Content-Type and Content-Disposition headers. The extension does not read web pages.

Test Page

Without the extension running, you get bad results for the zip file links and embedded PDF on the following page, and the extension fixes it: https://www.jeffersonscher.com/res/badct/

Hat tip

The code draws from the Display inline extension from samlh: https://addons.mozilla.org/firefox/addon/display-inline/.

Content-Type Fixer 是做什么的

Content-Type Fixer 是一款面向 Firefox 的下载管理类扩展,主要用来接管浏览器下载、批量抓取资源、加速大文件。官方对它的介绍是:Firefox doesn't follow instructions for downloads? "Always Open Similar Files" is missing? This usually happens because the server sent Firefox a wrong/generic Content-Type header, or forces a download with Content-Disposition. Here's a fix.在Firefox 附加组件商店(AMO)上,它当前版本 1.7.5,评分 4.71(45 人评价),约 1,683 名用户。

适合什么人用

从功能定位看,Content-Type Fixer 更适合经常下载视频、素材或整站资源的用户。如果你平时只是偶尔遇到相关需求,用浏览器自带功能也能凑合;但如果这件事每天都发生,装一个专门处理它的扩展通常比手动操作省事得多。需要注意的是它作用于所有网站,装上后建议先观察一两天,确认不影响常用站点的正常使用。

怎么安装 Content-Type Fixer

  1. 打开Firefox 附加组件商店(AMO)上的官方页面;
  2. 点「添加到浏览器」并确认权限提示;
  3. 装好后在扩展列表里固定图标,方便随时开关。

本站只做索引与介绍,安装包来自官方商店。如果商店页面提示当前地区不可用,说明该扩展未在你所在区域上架。

常见问题

Content-Type Fixer 是免费的吗?

Content-Type Fixer 在Firefox 附加组件商店(AMO)免费提供下载。它是浏览器扩展,装上就能直接用,不需要注册账号。

Content-Type Fixer 安全吗?

它只申请了 0 项权限,范围比较克制,没有申请「读取所有网站数据」这种大权限。

Content-Type Fixer 支持哪些浏览器?

当前收录的版本来自Firefox 附加组件商店(AMO),适用于 Firefox。同一个扩展在其他商店可能有对应版本,但功能与版本号不一定相同。

怎么卸载 Content-Type Fixer?

在扩展管理页找到 Content-Type Fixer,点移除即可。它在本地保存的设置会一起清掉,不会残留数据。

权限清单 来自 manifest.json 原文

站点访问 1

  • <all_urls>

接口权限 3

  • storage
  • webRequest
  • webRequestBlocking