Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Mozilla Firefox with a PDF viewer plug-in. The plug-in has been correctly associated with Adobe Reader files to view them in the browser in the settings.

I would like to be able to view PDF files in Firefox rather than downloading them. This already works correctly when a web server indicates that a file has the Content-Type of application/pdf. However, some web servers provide other Content-Types for PDFs, such as application/octet-stream. (See this example of a PDF served with a non-pdf Content-Type.)

I have looked at Firefox's MimeTypes.rdf file, and it appears to only support mapping applications based on file extensions for non-Internet-based files. (It looks like it only uses Content-Type to map Internet-based files.)

How can I have Firefox view all PDF documents in-browser rather than only the ones with the application/pdf Content-Type?

share|improve this question

Firefox has no content inspection code (e.g. the linux file command) to detect the actual content type and rely on the Content-Type header.

Workaround: mozplugger extension

See man 7 mozplugger:

          This is a comma separated list of extensions that should be associated with this particular mime type. The  exten‐
          sions are only used when a web server does not report what type of file it is, or when loading files directly from

Workaround: human interaction

Save the file and open it in the file explorer ;-)

Workaround: misconfiguration

An additional workaround is to hack mimeTypes.rdf and assign application/octet-stream to the same value as application/pdf.

I don't advice this workaround.

share|improve this answer
The description of the mozplugger extension seems to imply that it only works when the web server doesn't indicate the Content-Type. (I use Windows, so it looks like I can't test it.) – Sam Nov 1 '12 at 6:36

You can use Force Content-Type extension for pdf files with wrong Content-Type response header.

For example if web server provides Content-Type: application/octet-stream you can add rule to transform it to Content-Type: application/pdf based on pdf file url, like this:

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.