Open in Browser is a Firefox extension that opens PDFs, images directly instead of downloading them

Ashwin
Feb 17, 2020
Firefox, Firefox add-ons
|
5

Firefox as you know, has built-in support for viewing some document formats like TXT, PDF, XML and image formats. But sometimes you get a download dialog open up, instead of the content being displayed.

Open in Browser is a Firefox extension that opens PDFs, images directly instead of downloading them

That's not convenient if you prefer that the content is opened in the browser, and is precisely what the Open In Browser extension for Firefox is meant to fix.

How does it work?

When you click on URLs that contain a file, websites return a MIME type (Multipurpose Internet Mail Extension) to your browser; these contain something called a "content-type" header.

Sometimes, the data that is provideds may not work as intended, for e.g. you might have clicked on an image to view the full-size version, but instead Firefox shows you a download option instead of opening it right away in the browser.

Example 1: The browser will directly download the PDF.

Open In Browser example 1

Example 2: Clicking a document's (or image's) URL prompts the download dialog instead of allowing the browser to view it.

Open In Browser example 2

Surprisingly both links didn't open the documents, despite the fact that the "Preview in Firefox" option for PDF had been enabled. I tested other PDFs from my inbox, Internet Archive, etc and they all opened directly.

I installed the add-on and tried accessing the same URLs. A new prompt appeared and Open in Browser detected them as "server sent MIME". It had an option to open it with Firefox. This saves you the trouble of downloading and opening it. Another advantage is that your downloads folder doesn't get cluttered.

Open In Browser example 1 - fixed

open in browser

The extension also allows you to select the way the download should be handled; it can be used to open web files in five ways: As a text, a web page, an XML, an image or a PDF. This is of course limited to the browser's capabilities.

Obviously, you will need compatible content as well for this to work. e.g. text documents, PDFs or PNGs. Other file types will be downloaded as they're normally handled by the browser.

Open In Browser options

There is a caveat, you will see the download dialog twice anytime you try to download something (EXEs, ZIPs, MSIs etc) when you have the extension installed. There is a fix for this as well: head to the about:addons page, click on Open In Browser > Options. Enable the setting that reads "Never ask to confirm "Save File" action".

You will notice it has a link next to it that says "application/prs.oib-ask-once", click on it and you will see a download dialog pop-up. Enable the "Do this automatically for files like this from now on" option for  it, and the extension won't bother you with double download dialogs.

If the extension is not working with a particular file, try forcing it by going to the Tools menu (F10 or Alt) > Open in Browser > Enable for next request.

Warning: Never set the "Open with Firefox" option and then enable "Do this automatically for files like this from now on" option. Doing that will open blank tabs endlessly, thus crashing your session. This is not related to the add-on, but an issue with Firefox.

Open in Browser is an open source extension, the source code is available on GitHub. The add-on improves the browsing experience a bit, and saves some precious time.

Summary
software image
Author Rating
1star1star1star1stargray
5 based on 4 votes
Software Name
Open in Browser
Operating System
Firefox
Software Category
Productivity
Price
Free
Landing Page
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Anonymous said on February 18, 2020 at 2:18 am
    Reply

    stupid title tbh. if its opened in the browser or an native application, the data has to be downloaded first. (maybe not at once or as a whole, when it can be done in a data streaming way -whats not the case here-, but at the end, you end up with the same amount of data transmitted over your line.

  2. six feet above said on February 17, 2020 at 6:12 pm
    Reply

    about:config
    pdfjs.disabled – set to true

    in Preferences/Applications: set PDF Document to Always ask

    Download every .pdf file you come across.

    Then, in a Linux Terminal, use mat2 (the metadata anonymisation toolkit 2) to clean the file.

    Keep and archive the resulting file with “cleaned” in the filename, delete the original .pdf.

    “mat2 removes metadata from various fileformats. It supports a wide variety of file formats, audio, office, images, …”

    Aside from “evince”, “qpdfview” is a nice .pdf viewer for Linux, with tab support.

    1. Anonymous said on February 19, 2020 at 5:09 pm
      Reply

      But I’m feeling rebellious, so I’ll just leave pdf.js on, and then print my pdf to a PDF.

      Serious comment though: this particular extension has saved me a lot of hassle with sites that just insist that if I want to read a 1kb file named README with no extension I should save it to disk so I can struggle to open it in a text editor and then delete it afterwards.

  3. Anonymous said on February 17, 2020 at 4:41 pm
    Reply

    In order to get opened the PDF has to be processed first. Therefore the file has to be downloaded anyway in RAM at least even if there is no explicit download dialog. So far the title is misleading for average users at least.

  4. ULBoom said on February 17, 2020 at 4:11 pm
    Reply

    I’ve never had the issues described with pdf’s. My FF is set for pdf’s to Open in FF and nothing but that ever happens. This extension has some weird characteristics that I bet would cause it to be uninstalled quickly.

    It was written in 2013 for Chrome but didn’t work, so it died. It was revived in 2017 for FF, seemingly to address a minor annoyance while adding a major problem, the infinite tabs loading issue. Why?

    I can’t see any use for this or a good reason for reviewing it but I imagine some commenters will love it to death.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.