Blog
PDF Dark Mode in FirefoxBeyond the about:config Hack
Firefox's PDF.js viewer only darkens the toolbar— pages still render on white. Here's the actual fix.
Why Firefox's dark mode stops at the toolbar
PDF.js is intentionally conservative with page rendering — here's why, and what actually works.
PDF.js renders the page faithfully
PDF.js treats a PDF as authoritative — if the page background is white, it paints white. That's the right default for print/review work, but it's also why a “toggle” dark mode would be contentious: Mozilla would have to choose a color-inversion strategy that works for every document in the world. They haven't.
about:config → pdfjs.viewerCssTheme
This one comes up on every forum. Setting it to 2 darkens the chromearound the PDF — the toolbar, the sidebar, the page border. The page canvas itself stays white. It's a cosmetic fix dressed up as a feature.
Dark Reader and similar extensions
These apply a CSS filter on top of the rendered page. The result is the same as naive invert: photos become negatives, diagrams get mangled, and PDFs with any non-white background render unpredictably. Dark Reader itself notes limited PDF support in its documentation.
What PDF Dark does differently
- Uses the same PDF.js underneath — so compatibility is identical to Firefox
- Post-processes each rendered page pixel by pixel, detecting images by saturation before applying the theme
- Produces a downloadable dark PDF — no about:config, no extension, and no dependence on the Firefox session
- The file never leaves your browser; check DevTools → Network
How PDF Dark works in Firefox
You drop a PDF on the home page
From the PDF Dark home page, drag a PDF from your desktop, Downloads folder, or any Firefox file picker. Firefox hands the file to the page via the File API — no upload, no extension, no about:config.
Pages render inside the tab
We use the same PDF.js engine Firefox ships with, so anything Firefox can read, PDF Dark can read. Pages are painted to a canvas in your tab — same compatibility, just with the dark theme applied.
You pick a theme
Choose from Midnight, Sepia, Solarized, or OLED. The conversion runs in a Web Worker, so even a long document doesn't freeze the Firefox UI.
You download the dark PDF
Click Download and Firefox saves the dark version to your Downloads folder. Open it in Firefox again or hand it off to another reader — it stays dark, no per-viewer toggle needed.
Works on Firefox for Windows, macOS, Linux, and Android. Needs Firefox 90+ (Web Workers + OffscreenCanvas support).
Ready to read a PDF in dark mode on Firefox?
3 steps, no about:config, no extensions
Drop a PDF on the PDF Dark home page and download the dark version — runs right in Firefox.
Try PDF Dark →More from the PDF Dark blog
Different angles on the same converter — pick the post that matches your scenario. The drop zone is at the top of every page.
Invert PDF Colors
PDF Dark Mode in Chrome
Convert PDF to Dark Mode
PDF dark mode in Firefox FAQ
Does Firefox have a built-in PDF dark mode?
Partially. Firefox uses the PDF.js renderer, which supports a dark UI theme for the toolbar — but the actual page content still renders on a white background. There's no public preference to change the page canvas.
What about the about:config pdfjs.viewerCssTheme hack?
Setting pdfjs.viewerCssTheme to 2 does darken the toolbar and the area around the page, but the page itself stays white. It's a cosmetic fix, not a real one.
Do Firefox dark-mode extensions help?
Barely. Most Firefox extensions apply a CSS filter over the rendered PDF, which inverts images the same way it inverts text — you get photos as negatives and charts become unreadable. Dark Reader (the popular one) explicitly notes PDF support is limited.
Why is this page using PDF.js too?
Yes — we also use Mozilla's PDF.js for rendering. The difference is we render each page to a canvas, then apply a saturation-based color algorithm that treats text and images differently before reassembling the PDF. Same rendering library, very different post-processing.
Does this work on Firefox for Android?
Yes. Firefox on Android supports file upload and Web Workers. The conversion runs on your phone, saves to your Downloads folder, and the dark PDF opens in any reader afterwards.
Is the original PDF uploaded anywhere?
No. Everything runs in your Firefox tab. You can confirm this via Firefox DevTools (Ctrl/Cmd + Shift + E) — no upload request is made for the file.