Open MahdiNazemi opened 2 years ago
The PDF Viewer for Vimium C itself supports color themes and you can make it dark on its Options dialog.
There's no way to bypass this conflict, because an extension can not modify another extension's tabs directly.
Thanks for the explanation.
My theme is set to the system's, but the PDF is still black-on-white. Based on your answer, I suspect there is no solution for this.
Um dark reader can not modify "system-level (browser-level) color theme", while it just simulates the effects.
I found that adding the following CSS to PDF.js would make the background of PDFs black and their text white (source):
#viewerContainer > #viewer > .page > .canvasWrapper > canvas {
filter: grayscale(100%);
filter: invert(100%);
}
Adding an option to inject custom CSS in PDF Viewer for Vimium C would allow users to customize the looks of their PDFs.
This will break image displaying. Maybe I can add it when I have a longer rest.
+1, anything to allow darker pdf's would be great. I'm using Vivaldi, and it has a feature to simply invert the colors on the page, and it usually works for pdf's, but it doesn't work in PDF Viewer for Vimium C. Strangely, other, similar features still work, like changing to sepia-toned colors. (Vivaldi calls these "filters")
Do you know whether allowing "filter invert" in Vivaldi for the pdf viewer would be a simple PR I could put up? Happy to contribute if so.
I'm also curious about this. maybe @gdh1995 can help us understand how it works under the hood? Does the PDF extension kind of take-over the entire tab, so that Dark Reader (which injects some css afaict?) cannot modify it
Btw, is the PDF extension open-source (eg, is it somewhere in this repo)? Thanks!
Dark Reader is just an "extension" and then it can not affect other extensions including PDF Viewer. The way that Vimium C works on PDF Viewer for Vimium C
requires special handling in the two extensions.
BTW, Chrome has a plan to force extensions to use Manifest V3
, and when it lands, PDF Viewer for Vimium C
may fail to work with Vimium C - I've filed a bug report about the shortage of Manifest V3, but the Chromium team doesn't care it.
Coming back to this after a while. Do you know whether there's a simple way to allow "filter invert" to work with PDF Viewer? I notice that "filter sepia" works fine.
Describe the bug
When a PDF file is opened with Brave's default PDF viewer, Dark Reader can invert the colors in dark mode. However, when using PDF Viewer for Vimium C, the PDF's colors remain the same regardless of Dark Reader's light/dark mode.
Browser, OS, and Vimium C versions