How can I preview PDFs with Google Chrome in dark mode / reverse color?
By default it is white colored:
Followed-up by my asking How can I change the grey background of the PDF preview in Google Chrome to black?.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityHow can I preview PDFs with Google Chrome in dark mode / reverse color?
By default it is white colored:
Followed-up by my asking How can I change the grey background of the PDF preview in Google Chrome to black?.
div
overlay to any browser tab currently displaying a PDF document.const overlay = document.createElement("div");
const css = `
position: fixed;
pointer-events: none;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: white;
mix-blend-mode: difference;
z-index: 1;
`
overlay.setAttribute("style", css);
document.body.appendChild(overlay);
Enter
Special thanks: https://www.reddit.com/r/chrome/comments/e3txhi/comment/fem1cto
opacity: .5; background-color: #67645e
- even better!
You can use the Dark Reader Google Chrome extension and used the Filter+
mode. It will work on the online PDF files, but not at the local PDF files.
Hint from Hirbot Behnam:
If you want to make it work with local files (e.g. PDFs) too, go to chrome://extensions/ and click on Details button below the extension "Dark Reader" and from there, enable Allow access to file URLs.
chrome://extensions/
and click on Details button below the extension and from there, enable Allow access to file URLs
.
Nov 12, 2020 at 15:53