Why top Chrome PDF dark mode extensions fail on web-based PDF files
Chrome's built-in PDF viewer lacks a native dark mode, prompting users to install third-party extensions — but the most popular ones don't work on web-hosted PDFs. An investigation of their manifests revealed that both top extensions use host permissions scoped only to file:// URLs, meaning they only apply to locally stored PDFs dragged into the browser. PDFs opened from websites like arXiv, bank portals, or university course pages are left unaffected, explaining the widespread user complaints in their reviews. A separate technical issue involves CSS targeting: older filter methods no longer reach Chrome's out-of-process PDF viewer frame, requiring a different approach that applies the invert filter directly to the PDF document's root HTML element. Developers can distinguish between top-level and embedded PDFs using document.contentType, then apply the appropriate CSS filter accordingly.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in