I prefer the preview in Firefox option for PDFs, rather than downloading PDFs and then viewing them. However the default white background on the preview hurts my eyes. So is there a way that I can: preview PDFs in Firefox without having to download them and with inverted colors?

p.s.: "Dark background and light text" extension for firefox does invert the pdfs and it is good. But my default global preferences for this extension are different. Is there a way to tell the extension to "always invert pdfs". I add this as a footnote, because a solution that doesn't rely on this method is also welcome.


You are looking for an extension like this one.

It will make pages dark and text white, it even has some customization options and can be used on all pages or just one, I see no reason it would not work on PDF preview too, just open the menu and choose invert.

enter image description here

  • 3
    Yes that works. However my default global preferences for this extension are different. So every time I open the pdf I have to manually invert it. I don't see a way of telling the extension to "always invert pdfs". Do you know of a way? Feb 6 '17 at 16:56
  1. Install Stylus.
  2. Install this style.

enter image description here

  • I installed both software you mentioned and now it says it doesn't support pdf: "Stylus can not access some file types (e.g. pdf & json files)."
    – Pooya
    Aug 28 '19 at 1:57
  • @Pooya You can either 1. enable file access for Stylus or 2. directly copy paste the code snippet into your browser's userChrome.css and set toolkit.legacyUserProfileCustomizations.stylesheets to true in about:config. Aug 28 '19 at 2:00
  • I do not feel comfortable giving a web browser extension access to files on my machine.
    – Pooya
    Aug 28 '19 at 2:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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