Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF in Firefox: This page is protected by browser #8954

Closed
mamolas opened this issue May 25, 2022 · 3 comments
Closed

PDF in Firefox: This page is protected by browser #8954

mamolas opened this issue May 25, 2022 · 3 comments

Comments

@mamolas
Copy link

mamolas commented May 25, 2022

Uh, oh yeah PDF is for Firefox disabled as they already don't allow us to style any .pdf

Originally posted by @Gusted in #2856 (comment)

The issue is 2 years old, is the new Firefox also restricted to invert PDFs with dark reader? Is there any tweak at about:config to allow this important feature?

@Gusted
Copy link
Contributor

Gusted commented May 25, 2022

The page is protected, no exceptions for addons.

@Gusted Gusted closed this as completed May 25, 2022
@luo-chuan
Copy link

If you use Firefox, you can edit userContent.css like this:

@media (prefers-color-scheme: dark){
  .pdfViewer{filter: invert(1) hue-rotate(180deg);}
}

If you use Chrome or Edge, install the extention "PDF Reader", then edit the extention option like this:

html[data-theme*="dark"] .pdfViewer{
  filter: invert(1) hue-rotate(180deg);
}

@mamolas
Copy link
Author

mamolas commented Apr 16, 2024

As a workaround I have a bookmark with the following content:

javascript:(function(){var el = typeof viewer !== 'undefined' ? viewer : document.body; el.style.filter = 'grayscale(1) invert(1) sepia(1) contrast(75%)';})()

When I require to invert a PDF I click the bookmark and it works, although I think it could be embedded in the extension somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants