-
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
Improving CanvasPixelArray polyfill for Android #5004
Conversation
// Chrome < 21 lacks the set function. | ||
polyfill = true; | ||
} | ||
} else if (navigator.userAgent.indexOf('Android') >= 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.
I think, Firefox for android has it too, but does not need polifill
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.
yes, i checked that. FF for Android has it but will not pass the regex below.
I could turn it into 'Android ' and document the importance of the space in a comment if you think thats more explicit.
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.
That's fine, just checking
/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/60d1dbe4090c96b/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/60d1dbe4090c96b/output.txt Total script time: 0.72 mins Published
|
this could be merged. I checked that the polyfill is working correctly on older android phones. The performance is sub par, but that is not the problem of the polyfill. |
Improving CanvasPixelArray polyfill for Android
Looks good. Thank you for the patch! |
The old polyfill was only polyfilling IE which uses the CanvasPixelArray from window.
PR #4997 fixed the issue reported in #4974 that Chrome < 21 does not work.
The CPA used by those Chrome Versions is unfortunately inaccessible and needs to be patched every time it is created.
The same applies to old versions of the mobile browser in Android, as mentioned by #5002.
Android < 4.4 does not use Chrome, but a custom webkit based engine which does the same as Chrome < 21.
This PR detects Android 0-4 versions and polyfills them as well. Newer Android versions which use Chrome will still be handled by the check of PR #4997.
I also checked iOS and Mobile FF. iOS 6+7 are fine (they have the set method), iOS 5 does ot work at all, thus I did not bother polyfilling.