How can I change the grey background of the PDF preview in Google Chrome to black?

0

How can I change the grey background of the PDF preview in Google Chrome to black?

For example, on https://arxiv.org/pdf/1808.06394.pdf:

enter image description here

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:

enter image description here

However the background of the PDF preview in Google Chrome is still grey. Instead I would like something such as:

enter image description here

Franck Dernoncourt

Posted 2020-02-23T03:24:22.503

Reputation: 13 518

That background you want to change is not a part of the document but the gray part of the document reader itself. I am not clear on how Chrome or Windows would handle that, but it is literally “outside of the box” of what PDF adjustments can handle. – JakeGould – 2020-02-23T03:29:36.963

1@JakeGould I agree. – Franck Dernoncourt – 2020-02-23T03:31:26.573

How about this plugin? https://chrome.google.com/webstore/detail/change-colors/ageghplgcapnfpdhapeemolbmfccclke

– JakeGould – 2020-02-23T04:10:03.337

No answers