Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

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.

Всички отговори (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.