Emano-Waldeck / pdf-reader

a PDF reader extension based on Mozilla's PDF.js library for Chromium-based browsers
https://webextension.org/listing/pdf-reader.html
29 stars 8 forks source link

[Bug] CSS modification stopped working #15

Open Liz-chan opened 2 years ago

Liz-chan commented 2 years ago

I just noticed that the extension updated to 3.1.0, and the CSS that I use to make all the PDFs dark themed stopped working. I was wondering if it was a byproduct of updating to manifest v3, or a bug that was missed.

Here is the CSS snippet for reference:


#viewerContainer > #viewer > .page > .canvasWrapper > canvas {
    filter: grayscale(100%);
    filter: invert(100%);
}
Emano-Waldeck commented 2 years ago

I just tried this CSS on the options page, and it works fine for me. Try reinstalling the extension to see if it helps.

Liz-chan commented 2 years ago

It happens when I install the extension on a fresh Chromium instance too. It seems that PDFs are always dark now, even in light mode, so that CSS snippet up there that used to make it black in the previous version, still works, but now it just inverts the current dark mode one, so it looks a bit like a beige color with it.

Without the CSS: image

With the CSS: image

Emano-Waldeck commented 2 years ago

I have no idea what is causing the default dark view for you. You can use the DevTools to see the origin of the dark background when there is no CSS injection.

For me, on a clean install, this is how it looks:

default