-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[WIP] Update web/compatibility.js #4803
Conversation
It would be useful to have support comments indicating for which browsers a specific workaround is needed. In this way it'll be easier to know what workarounds can be removed in the future. |
I suppose more things could be removed; especially related to vendor prefixes. Just waiting for feedback first. |
})(); | ||
|
||
// Object.defineProperty() ? | ||
(function checkObjectDefinePropertyCompatibility() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I'm against removing the checkObjectDefinePropertyCompatibility polyfill just yet. I remember fixing at least two-three bugs related to the old androids 2.3-4.1(?) and safari 5(?). Do you have stats on usage for old webkit browsers on the internet?
We are automatically testing PDF.js only on Firefox and Chromium browsers, and even then we are not using compatibility.js. We count on support from the community to provide feedback and fixes for "other" browsers. Do we need to wait for people to test the patch? /botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/c83c79bbf6ba035/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/c83c79bbf6ba035/output.txt Total script time: 0.72 mins Published
|
It's possible some of these are needed for (really) old Androids; I'll try to check it and add proper comments so that the support story is clear. |
@yurydelendik Feedback from others would be great. :) I'm trying to make it all a little smaller since the file already has 500 lines and maybe not all of that is needed. If sth is, I'd like it to be annotated. Update to the PR coming soon. |
(it's not urgent to merge this one fast; I'll happily wait for more feedback) |
MDN and Can I Use provide a wealth of information about browser compatibility features, including a table with usage statistics derived from StatCounter: http://caniuse.com/usage_table.php. |
Right, but there is no bug information, e.g. there are several defineProperty bugs in old browsers that are/were important for pdf.js to work properly. |
I restored a couple of workarounds with concrete support comments (I run the tests on different browsers in BrowserStack). BTW, what was the purpose of the |
I also improved the |
Another thing I improved were some I guess pdf.js doesn't need them exactly on the prototype but on the XHR objects, right? Changed the commit title to reflect the broader scope of this PR.\ EDIT: the relevant Chromium ticket is crbug.com/43394 |
// Android 2.x has so buggy pushState support that it was removed in | ||
// Android 3.0 and restored as late as in Android 4.2. | ||
// Support: Android 2.x | ||
if (!history.pushState || navigator.userAgent.indexOf('android 2.') >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User uppercase A in Android. See https://developer.chrome.com/multidevice/user-agent and http://www.useragentstring.com/pages/Android%20Webkit%20Browser/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx, fixed. I was copying from a regex with the i
flag. :)
OK, I'm done for today with this PR. @yurydelendik, please review the changes. EDIT: I added support comments in the form |
How can we be sure that this does not break anything in older browsers? Can we test this somehow? |
@timvandermeij I run the tests in Of course, it's always possible a test was faulty, wasn't catching everything etc. but there's no way around that, people just need to test & report issues. I try to be cautious here. |
1) Remove obsolete workarounds 2) Add support comments
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/e4b90de8aa1278d/output.txt |
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 1 Live output at: http://107.21.233.14:8877/44f37e47dbc4a9a/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/e4b90de8aa1278d/output.txt Total script time: 0.72 mins Published
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/44f37e47dbc4a9a/output.txt Total script time: 0.74 mins Published
|
Okay, let's try this. But we probably need to run that across all devices/OSes later just to set baseline. |
[WIP] Update web/compatibility.js
Thanks |
Original description:
Object.create
&Object.defineProperty
issues concern IE<9 and really old WebKit versions.Object.keys
is universally available outside of oldIE as well, including Android 2.3. Firefox has unprefixedrequestAnimationFrame
long ago and the fallback to using a custom function is only slower but works.