Rob--W / open-in-browser

A browser extension that offers the ability to open files directly in the browser instead of downloading them.
Other
83 stars 15 forks source link

no 'open in browser' option for a pdf #49

Closed legolas-a20 closed 5 years ago

legolas-a20 commented 5 years ago

When I enter this url: www.pdf995.com/samples/pdf.pdf

I get the default Firefox dialog with 2 options: 'open with ' and 'Save File'. What I would like to do is open the file in the browser, but it seems like it doesn't get intercepted by the addon? (This was one of my main uses for the spasche/openinbrowser addon before.)

Options: 'Disable Content sniffing for text/plain' is off 'Get MIME from file extension for application/octet-stream' is on 'Never ask to confirm "Save File" action' is on, (but I've tried with this off as well).

Rob--W commented 5 years ago

This URL returns a PDF document with the right MIME-type ("application/pdf") and no download hint (i.e. no "Content-Disposition" header). Therefore it should have been displayed inline already by Firefox's default PDF viewer.

When I open the above URL, I can confirm that the PDF is opened in the browser (no dialog needed). Do you have any customizations that may affect Firefox's ability to view PDF files?

legolas-a20 commented 5 years ago

I have some other addons, but disabling them all results in the same behavior (both with open-in-browser disabled and enabled).

However, after some googling I've found the 'Applications' settings in Firefox were set to 'Always Ask' for pdf, I'm not sure why. Changing that to 'Preview in Firefox' does show the preview in Firefox.

So I think that fixes it for me. I'm still thinking if I would like the option for the dialog that asks between show in Firefox and save to always show, even if Firefox can preview, but right now I think that would at least for pdf's not be what I want, so the current situation seems good. Thanks for your quick reply!