6

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.

2 Answers 2

3

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

1
  • 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, 2017 at 16:56
0

enter image description here


Method 1 (may not work)

  1. Install Stylus.
  2. Install this style.

Method 2

  1. Set toolkit.legacyUserProfileCustomizations.stylesheets to true in about:config and create a file in .../Firefox/Profiles/$PROFILE_DIR/chrome/userContent.css.

  2. Paste the following into userContent.css:

    @-moz-document regexp("^https?://.*\\.pdf(\\?[^\\./]*)?$") {
      .pdfViewer .page {
        filter: invert(0.95) hue-rotate(180deg);
        border: 9px solid #00DEAD00 !important;
      }
    }
    
3
  • 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, 2019 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, 2019 at 2:00
  • I do not feel comfortable giving a web browser extension access to files on my machine.
    – Pooya
    Aug 28, 2019 at 2:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .