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.js not working in safari browser on MAC OSX 10.8.2, safari version 6.0.1 #3260

Closed
Sguo12 opened this issue May 15, 2013 · 5 comments · Fixed by #3315
Closed

Pdf.js not working in safari browser on MAC OSX 10.8.2, safari version 6.0.1 #3260

Sguo12 opened this issue May 15, 2013 · 5 comments · Fixed by #3315

Comments

@Sguo12
Copy link

Sguo12 commented May 15, 2013

Not even with the demo:
http://mozilla.github.io/pdf.js/web/viewer.html

Here is the error message:

PDF.js v0.8.169 (build: 869b878)
Message: Unexpected server response (206) while retrieving PDF "http://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf".

@brendandahl
Copy link
Contributor

It seems there are multiple issues since the behavior changes based on refresh, but something is wrong with safari and doing multiple range requests. For instance:
pdf.js requests: 327680-393216
safari gives back: 262144-327680

Even setting a no-cache header doesn't seem to help. I think we'll have to just do UA sniffing and disable range request loading for safari.

@ear
Copy link

ear commented Feb 26, 2014

I have found a new work-around for the Safari bug.

You can make Safari discard the cache that is poisoning the requests for new ranges by making them unique in a special way. The trick is generating a random string for each new request and add a header of the form If-None-Match: "<random string>".

I have tested this on OS X Mountain Lion and Maverick's Safari, as well as on the latest iOS. Here's a link to the relevant webkit bug

I hope this will let you re-enable range requests.

@blakekohler
Copy link

I'm having this same issue even with the newest version of the compatibility.js that fixes the range issue. Does anyone else have any ideas about how to solve this problem? I can't get http://mozilla.github.io/pdf.js/web/viewer.html to load in safari on an ipad, giving me the (206) error.

@jkruis
Copy link

jkruis commented Jun 12, 2014

This is broken in Safari, both mobile and desktop, for bigger files (probably bigger than 65K, the value of RANGE_CHUNK_SIZE).
See http://kruisit.nl/projects/pdfjs/1.0.277/ for reproduction. The testcase is based on the helloworld example.

Firefox logs a bunch of "206 Partial Content" results and works fine; Safari logs the warning "Unhandled rejection: Unexpected server response (206) while retrieving PDF" and shows nothing.

@timvandermeij
Copy link
Contributor

This is being tracked in #4898.

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

Successfully merging a pull request may close this issue.

6 participants