Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

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.