Closed Bug 776335 Opened 12 years ago Closed 12 years ago

Firefox should be able to open PDF files with bad content-type using the Open dialog, like Adobe Reader can

Categories

(Firefox :: PDF Viewer, defect)

x86
Windows 7
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 167320

People

(Reporter: spammaaja, Unassigned)

Details

Attachments

(1 file)

(deleted), application/something
Details
The Open dialog doesn't open PDF files in Firefox. If you select "Open with -> Firefox", the Open dialog is re-shown and the "Preview in Firefox" setting is automatically reset to "Ask always". If you choose "Do this automatically for files like this from now on", Firefox will open new tabs infinitely.
Please provide an example URL of such a PDF
Attached file example (deleted) —
Content type is application/octet-stream so that the open dialog is shown.
Attachment #644948 - Attachment mime type: application/octet-stream → application/something
Changed content type to application/something for better reproduction.
Also, if you "Do this automatically for files like this from now on" in the example, you will not be able to open PDF files via Windows Explorer anymore.
There are also good examples at http://www.netposti.fi/ but you need an account to that site, which requires a Finnish snail mail address. About comment 4: Actually you don't need to select "Do this automatically for files like this from now on" to get a semi-permanent denial of service. You just need to open the file, and you can't open PDFs in Firefox via Explorer anymore unless you remove the application/something entries from mimetypes.rdf manually or just use the reset button.
Firefox doesn't support opening application/something. The PDF viewer supports only application/PDF. The endless tabs are bug 167320
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Does the mime type even matter with the open dialog? It downloads the file to the %temp% folder and opens the file. The open dialog works with the add-on version of PDF viewer.
I think this is a separate bug, since it prevents Firefox from being used as the only PDF program and since it works with the addon version. You will always need Adobe Reader or some other PDF reader on the computer. Adobe Reader can open PDF files even with an invalid MIME type (as a separate window).
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Summary: Can't open PDF files in Firefox with the Open dialog → Firefox should be able to open PDF files with bad content-type using the Open dialog, like Adobe Reader can
No, it's the same bug. You can and should not assign Firefox as helper application. This will not work since Firefox doesn't have to guess the mime-type if it calls itself for a given file. It works if you save the file and open it later again from the disk. In that case Firefox knows nothing about the content-type of the file and it will use content sniffing and that result in a correct content-type. You have the exact same issue if Gecko receives a text file with a content-type text/logfile and an extension .txt
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → DUPLICATE
(In reply to Matthias Versen (Matti) from comment #9) > No, it's the same bug. > You can and should not assign Firefox as helper application. This will not > work since Firefox doesn't have to guess the mime-type if it calls itself > for a given file. I think this could be solved with a separate application, let's say FirefoxFileOpener.exe, which is used as the helper application. The application opens Firefox with the file you want to open as a parameter. The problem is that you're then unlikely able to open PDF files directly in Firefox without an open dialog. > It works if you save the file and open it later again from the disk. In that > case Firefox knows nothing about the content-type of the file and it will > use content sniffing and that result in a correct content-type. > You have the exact same issue if Gecko receives a text file with a > content-type text/logfile and an extension .txt The problem is that if you do anything (other than cancel) with a PDF file that has a bad MIME type, Firefox becomes unable to open locally saved PDF files until the user hits the Reset Firefox button or edits mimeTypes.rdf manually. This means that if you want to open that file without causing any damage to the Firefox profile, you'll have to use a different browser or a separate Firefox profile.
I know how to partially fix this issue!!! All what Mozilla developers need to do is make Gecko to handle unknown file as TEXT file. Take any binary file (not very large) and change its extention to .txt - that's it! Now Firefox opens it just once in one tab. Seems a joke? Partially.
>All what Mozilla developers need to do is make Gecko to handle unknown file as TEXT file. Firefox would render this file in the browser since it supports displaying text files. A 2GB binary file that will be rendered will take several hours to get displayed and freezes the browser except if it get killed due to OOM. There are no unknown files for http/1.0, http/1.1 servers as they have to send a content type. Sniffing the content is no allowed according to the http rfc.
"Content-Length" should be allowed within server response headers. Nevertheless, anyone (the developers should too) can catch himself thinking sometimes about why other browsers are free from the issue...
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: