Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Vyhľadajte odpoveď

Vyhnite sa podvodom s podporou. Nikdy vás nebudeme žiadať, aby ste zavolali alebo poslali SMS na telefónne číslo alebo zdieľali osobné informácie. Nahláste prosím podozrivú aktivitu použitím voľby “Nahlásiť zneužitie”.

Learn More

How can I view pdfs in night/dark mode within the Firefox Quantum browser?

more options

As of Quantum, it seems that Firefox will not allow any extensions/add-ons to modify their pdf viewer page, and Firefox will also not allow any other third party pdf viewers to be used (within the browser). That would be ok, I guess, if the Firefox viewer had a night mode built in or were otherwise a little more feature-rich. Is there something I haven't tried yet? And yes, I know I can choose to open a pdf in a third party application, but opening it within the browser would be much preferred.

As of Quantum, it seems that Firefox will not allow any extensions/add-ons to modify their pdf viewer page, and Firefox will also not allow any other third party pdf viewers to be used (within the browser). That would be ok, I guess, if the Firefox viewer had a night mode built in or were otherwise a little more feature-rich. Is there something I haven't tried yet? And yes, I know I can choose to open a pdf in a third party application, but opening it within the browser would be much preferred.

Všetky odpovede (2)

more options

Hi beersteiner, the viewer itself has a dark theme. Do you mean you want the appearance of the PDF file itself inverted to light text on a dark background? Hmm...

Although extensions cannot modify tabs using the PDF Viewer, the userContent.css file can inject alternative style rules. For example, playing around in the Style Editor tool, I was able to apply an "invert" filter by clicking the + to create a new style sheet and then using:

.page {
  filter: invert(100%);
}

Example "before" and "after" screenshots attached.

When saved in a userContent.css file there is a risk that could affect other pages. To minimize that risk, you could use a selector that follows the presumably unique structure of the viewer:

#outerContainer > #mainContainer > #viewerContainer > #viewer > .page {
  filter: invert(100%);
}

I haven't gone all the way to setting that up in userContent.css to test it. Maybe later when I have some more time.

more options

Hmm, the invert rule would flip a dark PDF to light, so it's not an ideal solution.