-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
IOS webview APP error: Unexpected server response (206) while retrieving PDF... #7815
Comments
Looks like WeChat (the browser we don't support) has no "Safari" in it's user agent string (?). I cannot find any specific documentation on what user agent string shall be, probably something along "MicroMessenger/6.3.27" lines. We don't know market share of WeChat + PDF.js + iOS users, so I don't think we shall rush into adding that to the compatibility.js. |
Until March, 2016, there are 0.927 billion active WeChat users in China. So it is very important to solve this PDF.js bug on WeChat. @yurydelendik |
|
@godwin668 we gave it a try with #7800, but it did not work for you. Can you help us with proposing a solution? |
@yurydelendik I do NOT know exact number but I do know two professional online preview provider is using PDF.js in China. I'm NOT specialty in PDF.js, but I will try. |
solve issue: mozilla#7815 mozilla#7754 mozilla#7800
@yurydelendik I tried and succeeded. |
Better way but NOT necessarily best way to solve the IOS webview APP error: Unexpected server response (206) while retrieving PDF... Details: 1. At the beginning, I only found the Error in IOS WeChat APP, so I solved it by checking WeChat: 9ad57d4 2. But I found this error in other IOS app, so I checked UA details of them as follow: a) iPhone WeChat APP UserAgent (Fail): Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Mobile/14B100 MicroMessenger/6.3.30 NetType/WIFI Language/zh_CN b) iPhone Other APP UserAgent (Fail): Mozilla/5.0 (iPhone; CPU iPhone OS 10_1_1 like Mac X) AppleWebKit/602.2.14 (KHTML, like Gecko) Mobile/14B100 QYZone Maybe all webview app in IOS 10 have this problem, and since Safari & Chrome in IOS also does NOT support range request in IOS, so I think it's a better way to disable range request in iPhone by this regex: var isIPhone = /iPhone/.test(navigator.userAgent); if (isIPhone) { PDFJS.disableRange = true; PDFJS.disableStream = true; } solve issues: mozilla#7815 mozilla#7754 mozilla#7800
Link to PDF file (or attach file here):
https://mozilla.github.io/pdf.js/web/viewer.html
Configuration:
Steps to reproduce the problem:
What went wrong? (add screenshot)
The text was updated successfully, but these errors were encountered: