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!

Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

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.

Tất cả các câu trả lời (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.