How can I change the grey background of the PDF preview in Google Chrome to black?
For example, on :
using this code in the console (and disabling the Dark Reader Google Chrome extension if it was enabled):
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);
document.body.appendChild(cover);I can make the white background black:
However, the background of the PDF preview in Google Chrome is still grey. Instead I would like something such as:
Following my asking How can I preview PDFs with Google Chrome in dark mode?, now asking about changing the design for the rest of the screen.
32 Answers
Zoom in to Full Page width, or change Window Size, so PDF reaches edge (with Dark Reader from your question):
For example, on (*):Now you still have the "gray color border" imposed by Google Chrome (whose bright idea was that, was it a full thought? We can blame trees for white paper.), but you're not forced to take that as the full version.
Ideally being a Black background would be obvious, computer code would enable us to disable these unconsciously scripted forms to be self-edited, it's not just a form of accessibility, it's about designing to be accessible in the lowest code logic.
2There is a way to get the pdf to look the way you want it using Microsoft Edge. If you have Edge in light mode the background of the PDF viewer will be white. By inverting the colors with the code you pasted/using an extension (like Dark Reader), the result you describe can be achieved.