Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Firefox Mozilla

Firefox 78 To Prevent Websites From Forcing Users To Save PDF Documents (thewindowsclub.com) 69

"Firefox will prevent websites from forcing users to directly save PDFs without opening them in the web browser window," reports The Windows Club.

"Mozilla is rolling out this feature to the masses with the stable release of Firefox 78." Right now, Mozilla has added this feature to Firefox 78 in the Nightly channel.

The issue was first raised in 2011, and it took Mozilla 9 years to fix it. Many websites host and offer PDF documents with the following HTTP header:

Content-Disposition: attachment; filename="whatever.pdf."

This is an indication to the web browser that the PDF file should be saved with the specified name rather than try opening it in the web browser window. But since Firefox has a built-in PDF viewer, it should be for users to decide whether they want to view or save PDF documents.

This discussion has been archived. No new comments can be posted.

Firefox 78 To Prevent Websites From Forcing Users To Save PDF Documents

Comments Filter:
  • by AleRunner ( 4556245 ) on Saturday May 23, 2020 @02:42PM (#60095498)
    First the Facebook containers (which you can extend to have containers for everything) and then stopping evil sites. What could be next? Making it so paste always works when you want it? When did Mozilla suddenly rediscover their users? This is wonderful. I've gone back to Firefox recently and it really is beginning a comeback.
    • Making it so paste always works when you want it?

      So, Javascript can catch copy/paste events. This has perfectly good uses for some programs, such as online word processors. It's annoying as hell when abused. To fix, go to about:config, find dom.event.clipboardevents.enabled and set to false. I believe there some extensions too to help with this.

      • > This has perfectly good uses for some programs, such as online word processors.

        So pop up a permission request when a website wants to override pro-user browser behavior.

        "docs.google.com (verified) would like to manage your clipboard. [Allow/Deny]"

        Let's call it the "Don't Piss Off Your Users By Default" design pattern.

        • by AmiMoJo ( 196126 )

          Problem is the average user will look at that and wonder what docs.google.com is, what verified means, how it intends to manage the clipboard they keep in their desk drawer and what the consequences of denying it would be. That's why most of them just blindly click "allow" to everything, if their computer screws up they just call IT or their geeky family member to fix it.

        • yep, should also be warning if website is trying to read your mouse position in javascript etc. The problem is every major website would trigger all of these warnings because everyone is scrapping everything they can.
    • by AmiMoJo ( 196126 )

      If they could just fix Firefox Mobile... The preview version is actually very good in general, it just has layout problems.

      • by amorsen ( 7485 )

        The preview version is amazing. I haven't hit layout problems, but I'm sure they're there, since it seems to have a somewhat free interpretation of the HTML/CSS, particularly when it comes to font sizes. This leads to some sites being a lot easier to deal with than they are in other browsers.

        The major problem that made me give up on it is lack of addon support. It is too painful to browse without ublock.

        • by AmiMoJo ( 196126 )

          uBlock and a few others are supported now, just go into the add ons menu and you can install them directly.

        • Ublock Origin IS available in Firefox Preview and so are a few other addons. What I really miss is the ability to set your own Firefox Sync URL if you run your own Sync server. This is not possible in Preview. In other versions of Firefox you can do this via about:config.
  • by presidenteloco ( 659168 ) on Saturday May 23, 2020 @02:44PM (#60095504)
    and put it as default if the user later chooses to save the pdf. Otherwise, useful information has been lost.
    • by Anonymous Coward on Saturday May 23, 2020 @03:11PM (#60095580)

      Agreed, not only that but I actually don't like the shitty in browser PDF viewers. Usually if I'm clicking a link to a PDF it's because I want to download a copy of it to store permanently, not to look at it in some shitty browser viewer as a transient event.

      Given PDFs are usually things like manuals, legal documents, and that sort of thing, then downloading it should be the default option. It should only show in the browser if I choose the browser as my default PDF viewer, which I would never do, because it's shit at it.

      This is another of those things where someone realised they could do something and so they did, rather than asking the question whether anyone actually even wanted it and so wasted time implementing something that is simply annoying as hell.

      • by holophrastic ( 221104 ) on Saturday May 23, 2020 @04:15PM (#60095880)

        Agreed. Please mod-up. I build reporting systems for corporate web-sites. It's presented in HTML as a normal web-page to be viewed immediately. The only reason to go through the hell of producing a PDF is for saving-for-later purposes. Especially these days since print-to-pdf works perfectly.

        • I build reporting systems for corporate web-sites. It's presented in HTML as a normal web-page to be viewed immediately. The only reason to go through the hell of producing a PDF is for saving-for-later purposes. Especially these days since print-to-pdf works perfectly.

          Good for you. However, do you really assume that everyone uses the internet for the exact same reasons that you do? Plenty of websites have PDF documents for many different purposes. I've seen plenty of PDFs for checklists, recipes, newsletters, new user guides, etc.

          One of the many reasons to create a PDF is to capture the output of programs you know your target audience doesn't have access to. Want to show a monthly newsletter? Should you link it as a Publisher file or a PDF? Want to provide an AutoCAD

      • Re: (Score:2, Insightful)

        Nothing pisses me off more than a forced PDF download.

        I'm sorry for other users of other operating systems but on Mac, PDFs are just as easy to view as a PNG or a JPEG. Don't force me to download a file that Safari is perfectly able to display since it calls the same OS library to display it. It just increases the number of steps I have to do to view the PDF on top of having to delete a file I never wanted on my drive in the first place.

        • by Anonymous Coward

          Fortunately for you, Preview is a crap implantation and you're welcome to keep using it. What I hate is when someone insists it works in PDF.js or Preview, so it must be good, but they've actually hung their hat on the non-standard behavior, and as soon as you get it into Foxit or Acrobat or anything halfway sane, it goes right wonky.

          Or it's wonky in Preview and PDF.js and they don't realize they've been editing PDFs with tools that generate ill-formatted PDFs.

          I say this as my day job is writing code to han

          • AFAIK Preview is excellent for what it supports, which is to say it supports the static, printable document part of the specifications but not the insane, not-really-a-portable-document-format-anymore crap that was bolted on after that.

      • by CaptQuark ( 2706165 ) on Sunday May 24, 2020 @01:24AM (#60097506)

        I actually don't like the shitty in browser PDF viewers. Usually if I'm clicking a link to a PDF it's because I want to download a copy of it to store permanently, not to look at it in some shitty browser viewer as a transient event.

        Good for you. However, do you really assume that everyone uses the internet for the exact same reasons that you do? Plenty of websites have PDF documents for many different purposes. I've seen plenty of PDFs for checklists, recipes, newsletters, new user guides, etc.

        I would much rather see a preview of the PDF before I save it. It annoys me to click on a PDF link, be forced to save it, open the downloads folder and find the file, open the PDF, determine if it is what I expected or needed, and if not, delete the file and go back to searching. It's so much easier to see a preview of the document in the browser, then click the download button if it is the content I want.

        If the PDF is a 171 page manual for a new piece of equipment I bought, I would rather see the first two or three pages on the screen and realize I have the wrong manual, rather than waiting for the entire document to download, then open it before I realize it is for the wrong model.

        ---

      • by amorsen ( 7485 )

        It is reasonably easy to disable the built-in PDF viewer. I have it turned off; I need the full screen height to read PDF documents.

    • Firefox already does this?

      You open a PDF in-browser and when you hit Download it keeps the document name.

      So, you seem to be suggesting a feature that already exists.

    • by AmiMoJo ( 196126 )

      It does that already, I can't imagine why they would change it.

  • My two beefs (Score:5, Insightful)

    by AndyKron ( 937105 ) on Saturday May 23, 2020 @02:46PM (#60095516)
    Can they block the "subscribe to our bullshit newsletter" popups, or those fucking videos that slide down the page when we don't want to watch them?
    • Those things just go away when you don't visit those websites...
    • Yes! They did so by implementing afddons instead of forcing one solution on all. Install uBlock Origin, and enable some of the Annoyances filters, and most of that stuff goes away.

  • This will be bad for printing., I have experienced cases where a pdf printed from a browser looked different, especially table borders that were used to display a time graph would not print the same from a browser as from a pdf viewer.

    • You can always save the PDF to disk or open it with a separate application.
    • by Anonymous Coward

      That's because PDF.js doesn't properly handle illegal MediaBox values in the first two arguments, and has its own behavior of "trying to guess what you wanted and running with it."

      Source of much of my sorrows at work...the primary sin of the Greeks was not sodomy, but extrapolation.

  • I'm confused (Score:5, Interesting)

    by fahrbot-bot ( 874524 ) on Saturday May 23, 2020 @02:52PM (#60095532)

    Will Firefox force users to view the document in the browser with the option to then save it to a file or simply provide the user with the option to view/save the PDF rather than just save?

    Also noting that I still have the built-in PDF viewer disabled -- it was initially crap, but maybe it's better now, and didn't work with some things like USPS Click-and-Ship, but the PO has changed things so maybe that's not an issue anymore.

    • by Resuna ( 6191186 )

      That was my first thought. I rarely want to view PDFs immediately, and when I do an extra step of opening the file from the download manager is not a big deal.

    • by AmiMoJo ( 196126 )

      It's so good I use it on Chrome over the built in Chrome one.

    • I already have 2 other programs to view and manipulate pdfs. I don't need a 3rd lame UI from FF to learn, and which will change completely and inscrutably with every new release. I have had the FF viewer turned off ever since it was born, and I want to keep it that way. Same with chrome and the other pretenders to the throne.
  • Mixed feelings (Score:5, Interesting)

    by darkain ( 749283 ) on Saturday May 23, 2020 @02:56PM (#60095548) Homepage

    I have mixed feelings about this. It is actually very rare that I want to view a PDF in a browser, since it is also an inferior experience. Generally for me, PDFs are forms that need filling out, printed, and filed for some legal requirement.

    Browsers have a built in mechanism that allows content developers to specify if the content should be viewed or downloaded. This is called Content Disposition. https://developer.mozilla.org/... [mozilla.org]

    One of the web sites I manage is a photo hosting site. Each photo has a button next to it to "download image", which uses this header to tell the browser to save the image rather than view it. I've also use this in the past on an ecommerce platform for PDF invoices.

    For less tech-savvy end-users, this was an amazing feature.

    As someone who handles IT tech support for a few organizations, all Mozilla is doing with this one is generating more tickets and more training for an end result of... not really much of anything gained at all?

    • since it is also an inferior experience

      I used to think so before I realised it no longer required Acrobat to load in some container, or the software to start.

  • Most times I'm viewing PDFs it's just to view a restaurant menu - just to glance at, not to download and keep forever.

    • Re:This is great (Score:4, Insightful)

      by vux984 ( 928602 ) on Saturday May 23, 2020 @03:55PM (#60095776)

      Whereas most times I'm dealing with PDF I'm viewing banking and investment statements various billing records, and want them downloaded and filed away.

      This is an anti-feature for me, unless it can be turned off, or customized, in which case great! Always glad

      "Most times I'm viewing PDFs it's just to view a restaurant menu - just to glance at, not to download and keep forever."

      I just delete old stuff out of my downloads folder periodically; same as I clear out other temp folders. This not exactly a big deal.

  • Since when am I forced to save a pdf rather than opening it? I can't remember the last time a pdf didn't open directly in Firefox. I just tried it out on this page [irs.gov] and it opened directly in the browser. I was never asked to save it first.

    Am I doing something wrong?

    • Since when am I forced to save a pdf rather than opening it? I can't remember the last time a pdf didn't open directly in Firefox. I just tried it out on this page [irs.gov] and it opened directly in the browser. I was never asked to save it first.

      Am I doing something wrong?

      Yes, you're looking at the wrong url which is not sending the header that forces saving. Find one that sets the header Content-Disposition: attachment; filename="whatever.pdf.".

    • by jrumney ( 197329 )

      It is possible to force a file to be downloaded by using certain headers in the response. In theory it can be done for any file type, but it is most common with PDFs, because the whole point of using PDF instead of HTML was to eliminate browser differences in formatting, to ue advanced features such as document signing which is not supported by the browsers, or because the PDF is supposed to be a permanent record of something you've already seen on an HTML.

      I'm mixed about this change. On the one hand, it is

  • DO NOT WANT (Score:5, Interesting)

    by Ly4 ( 2353328 ) on Saturday May 23, 2020 @03:43PM (#60095704)

    I do not want this, at all.

    A use case: when I go to my bank, I'm usually downloading several documents that I am going to keep. The bank has web developers who know this, so they offer two options for each of the documents:

    View and Save

    I click on Save, because that's what I want to do. Each document goes relatively quickly - I don't have to wait for the js interpreter to parse through the PDF.

    If I wanted to view the documents, I'd click on the View button. But I don't; I'm adding the PDFs to my personal archive, which is something that PDFs are often used for.

    It sounds like Firefox is removing the option for my bank to provide the exact user experience that I want. And that's not good.

    • by Briareos ( 21163 )

      If your bank doesn't serve the PDF as application/octet-stream [mozilla.org] when you click on "Save", they're doing it wrong...

  • As long as I can disable/enable per a website, I'm good with it. Default it to using native PDF viewing.
  • I never want the goddamn things to open in my browser, I want to save them always.

    Same with MP4 video files, give me a link to the file please.

  • by WaffleMonster ( 969671 ) on Saturday May 23, 2020 @07:55PM (#60096800)

    Is the change after this version I will be able to have a web app that allows users to be prompted to save .jpg and .png files to disk yet Firefox will now explicitly deny the exact same operation for .pdf files?

    If so I'm strongly against this. These headers provide specific unambiguous indications to browsers. They should not be arbitrarily bypassed because one vendor thinks it knows better than everyone else. Doing this is 100% guaranteed to break software and cause unnecessary tickets.

  • by gravewax ( 4772409 ) on Sunday May 24, 2020 @06:32AM (#60097970)
    Can't remember the last time I wanted to actually view a pdf in a browser, if I want it opened I will open in a seperate pdf viewer that doesn't suck. So this is a really big I don't give a shit as long as they are going to give users a choice (and a choice that is remembered not fucking prompted every time).
  • I can't grab and pull the document like I could when I first opened a PDF with Adobe Acrobat Reader in like 1997. Since 16:9 is the final evolution of display ratios, display the document in either a new window with zero window header or get rid of window header in the tab with the document as the FF window header uses >10% of available vertical screen space which really matters with 8-1/2"x11" documents, which is pretty much all of the PDFs I download. Among the first things I do on a new install is co
  • I am sure 100 people have already commented that many of us have a view and save option. The latter adding the download. Also a lot of more formal PDF's (every single online VISA application) use PDF's that do not work in the browser.
  • Hopefully this shit ass crap fuck can be turned off. The last thing I want is for bloody PDFs to be opened in the farting useless web browser. I want them to either (a) save to disk or (b) open in a separate application.

    I hope these ass wipe muther fuckers are not going to diddle-fuck with something that works perfectly fine as it is (or that their diddle fucking can be turned off).

  • Back when XUL extensions were a thing I installed one called "Open In Browser". On the popup for how to Save/open a file type it would add a new option. "Save to disk", "Open in [system app]" and now "Open in browser as [TYPE]" where you had to select if it was an image, or what. If you clicked a file and the web site says you should save it to disk this would give you the option to override and open it in the browser anyway. Not just PDFs but also images for when an image was huge and you requested the hig

  • In my experience, Content-Disposition is mostly used because the website wants to specify the name of the file being downloaded, separately from what the URL is. Whether or not people actually download the file or view it in the web browser is largely irrelevant, and not something that any website I've worked on has been interesting in forcing a behaviour.

Ocean: A body of water occupying about two-thirds of a world made for man -- who has no gills. -- Ambrose Bierce

Working...