How can I preview PDFs with Google Chrome in dark mode / reverse color?

By default it is white:

enter image description here

  • Chrome is not part of Windows, why did you tag it Windows? – Mark Feb 22 '20 at 6:03
  • @Mark in case of OS-dependent solution. – Franck Dernoncourt Feb 22 '20 at 6:06

Paste this JavaScript code in your console:

var cover = document.createElement("div");
let css = `
    position: fixed;
    pointer-events: none;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
    mix-blend-mode: difference;
    z-index: 1;
cover.setAttribute("style", css);

Special thanks: https://www.reddit.com/r/chrome/comments/e3txhi/comment/fem1cto


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.

enter image description here

  • 1
    it works, thank you! – Lonely Jul 26 '20 at 18:22
  • If you want to make it work with local files too, go to chrome://extensions/ and click on Details button below the extension and from there, enable Allow access to file URLs. – Hirbod Behnam Nov 12 '20 at 15:53
  • This did not work for me when opening local pdfs – MaLiN2223 Nov 30 '20 at 21:07
  • @MaLiN2223 Correct, this doesn't work when opening local pdfs, which is quite annoying. – Franck Dernoncourt Nov 30 '20 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.