
Content-Type Fixer by jscher2000
Do you always get a download dialog for PDFs (etc.), and "Do this automatically from now on" doesn't work? This happens if the server sends Firefox a wrong/generic Content-Type header, or forces a download with Content-Disposition. Here's a fix.
Extension Metadata




Exception Notes
Version 1.7.1 ignores "Follow my settings (inline)" on Google Drive and for Gmail attachments due to cookie issues.
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).
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, .doc/docx, .epub, .pdf, .ppt/pptx, .psd, .rar, .rtf, .xls/xlsx, .zip, and .7z.
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.
There is a panel on the menu (starting in version 1.5) to individually enable/disable Content-Type overrides so you can have just the ones you need running.
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.
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/.
Version 1.7.1 ignores "Follow my settings (inline)" on Google Drive and for Gmail attachments due to cookie issues.
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).
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, .doc/docx, .epub, .pdf, .ppt/pptx, .psd, .rar, .rtf, .xls/xlsx, .zip, and .7z.
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.
There is a panel on the menu (starting in version 1.5) to individually enable/disable Content-Type overrides so you can have just the ones you need running.
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.
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/.
Report this add-on for abuse
If you think this add-on violates Mozilla's add-on policies or has security or privacy issues, please report these issues to Mozilla using this form.
Please don't use this form to report bugs or request add-on features; this report will be sent to Mozilla and not to the add-on developer.
- Add-on Links
- Version
- 1.7.1
- Size
- 54.3 KB
- Last updated
- 3 months ago (Feb 1, 2021)
- License
- Mozilla Public License, version 2.0
- Version History
Exception for Gmail attachments and Google Drive to allow downloading; style tweak to the log page.
- There are no ratings yet
- There are no ratings yet
- There are no ratings yet
- There are no ratings yet
- There are no ratings yet
- There are no ratings yet