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

Broken icons in Safari PDF viewer #2004

Closed
csdbz opened this issue May 31, 2021 · 11 comments
Closed

Broken icons in Safari PDF viewer #2004

csdbz opened this issue May 31, 2021 · 11 comments
Labels

Comments

@csdbz
Copy link

csdbz commented May 31, 2021

Any ideas on why Chrome is rendering PDF viewer buttons but Safari isn't?

Screen Shot 2021-05-30 at 7 04 03 PM

@OzzieIsaacs OzzieIsaacs added the bug label Jun 3, 2021
@OzzieIsaacs
Copy link
Collaborator

Have no idea, but it's also not working on iOS. Is there any error message in the developer/javascript console (don't know how it's called in safari).

@somel-web
Copy link

Here is the problem:
in chrome the url of svg are like this (-> ok)
https://xyz.com/static/css/libs/images/toolbarButton-viewThumbnail.svg
but in safari it's incorrect
https://xyz.com/read/446/images/toolbarButton-viewThumbnail.svg

/static/css/libs/ is replaced by /read/id_of_book

@OzzieIsaacs
Copy link
Collaborator

I doublechecked it. The old version of the reader (with the black background by default) worked well, the new one (the white background creates the problem). I tried updating to the newest version of pdf.js, but the problem still persists. I currently haven't figured out, why safari is having the problem, from my understanding Chrome, Firefox behalf correct.
There is one css file linking to the graphics. The standards say the root of the links shall be the location of the css file, safari takes the page where it's loaded from as it's root, this is the problem.
I did not find a solution to change the path to something which will work for Chrome, Firefox and Safari, and will also work for reverse proxy configurations.

@OzzieIsaacs
Copy link
Collaborator

Please update to the newest nightly version. For me it was working now

@somel-web
Copy link

somel-web commented Jun 5, 2021

Maybe this can help
mozilla/pdf.js#12942
The problem seems related to webkit (used is safari mac desktop and ALL browsers in IOS (safari/chrome/firefox…)

@somel-web
Copy link

IT WORKS !!
Just tested on ios but should be ok on safari mac desktop

@OzzieIsaacs
Copy link
Collaborator

Awesome. Thanks for finding the issue on the pdf.js. No help to expect from their side. I‘ll make a note on how to change the sources for the next pdf reader update

@somel-web
Copy link

Annother issue about webkit and pdf.js viewer css problems
mozilla/pdf.js#6685
One solution is to use a css filter like

@media all -webkit-device-pixel-ratio {….}
@media not -webkit-device-pixel-ratio {….}

https://stackoverflow.com/questions/15401375/css-media-check-if-not-webkit

@OzzieIsaacs
Copy link
Collaborator

The issue you are pointing to is claimed to be solved. Do you still have this problem?

@somel-web
Copy link

somel-web commented Jun 5, 2021

No it’s working, thanks a lot.
I didn’t want to reopen the issue but just leave a comment that could help for future debugging.
(Webkit related)

@OzzieIsaacs
Copy link
Collaborator

17DC6FA4-88C8-4126-89A6-900332EB6194
To me the icons seem sharp

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

No branches or pull requests

3 participants