-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Enable range requests in Safari (both OSX and IOS) #9824
Comments
Not really, and we would like to limit it where possible. Could you indicate from which Safari/iOS versions range request work again, since it was apparently broken before? |
@EugeneSqr are you familiar with related bug reports, e.g. #3260. Looks like https://bugs.webkit.org/show_bug.cgi?id=144682 addresses that in WK2 (after 2018-1-3). |
To me it looks like the 2018-01-03 update only affected the test cases and the actual fix was merged around 2015-05. This is also collaborated by comments in this bug report that dupes it: In that bug report you can also find an interesting dynamic workaround for issue in another project: |
For PDF.js 2.0 we only support Safari 8+. We didn't set a support for iOS, but looking at https://en.wikipedia.org/wiki/IOS_version_history#iOS_10 I think iOS 10 would be good (opinions @yurydelendik?). If range requests work for both those versions, we can remove the compatibility limit altogether I think. |
If it is possible to introduce a workaround outside main code base (only in compatibility.js), you are welcome to submit a patch. Patching main code base will not be considered.
Yes, I agree. |
I have done some internal testing and can confirm that removing the Safari limitations as @EugeneSqr stated results in working PDF streaming (with multiple 206 replies) on the following platforms: iOS 9.3.5 iOS 10.3.3 iOS 11.4 Safari 11.1.1 iOS testing was done on physical devices with a remote web inspector enabled. The benefits was huge for the 30MB PDF I was testing with. The testing was done with internal code (which this PR stems from) so I am not sure it is fully compatible with your processes, but it's the best I could do. |
I cannot remember, and don't have my old notes anymore, if there was ever an explicit decision to support Safari version According to https://en.wikipedia.org/wiki/Safari_version_history#Safari_8, the last release from the |
@fooware Thank you for looking into this. Given that range requests work again since Safari 9, I think we can remove the compatibility check because Safari 9 is the minimum version we support. @yurydelendik @Snuffleupagus I have updated https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#which-browsers-are-supported to reflect that we only support iOS 10 and higher for Safari, as decided above. When I made the overview there, I looked through the commits we did for version 2.0 and found a commit where polyfills were removed that stated that Safari 8+ was now the minimum, but I can't find it quickly anymore. However, since Safari 8 is almost three years old, I think we can safely drop explicity support for it, so I updated the page to reflect this too. I think it's a fair support we have now. If someone wants to create a patch to remove the compatibility code, please also bump Line 81 in 620da6f
>= 9 .
|
PR #9830 has been created |
Removed safari compatibility check (issue #9824)
Removed safari compatibility check (issue mozilla#9824)
@timvandermeij / @yurydelendik We use PDFJS - version - 1.7.331. We wanted to support range requests in safari. We cannot directly use master. So we tried moving to the stable version of PDFJS - 1.9.426 - this version too does not support range requests for safari browser. Is this fix available in any other patch version? Or is there any workaround for us to do this? |
Most likely this is only in the pre-release so far: https://github.com/mozilla/pdf.js/releases/tag/2.0.550 |
Attach (recommended) or Link to PDF file here: https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
The document is loaded using range requests
What went wrong? (add screenshot)
The document is loaded with a single request. It looks like range requests were explicitly disabled by this code here:
It feels a bit outdated. I've just tested pdfjs without this code in the specified browsers and it worked just fine. Is there a reason for keeping this code?
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
The text was updated successfully, but these errors were encountered: