Created
October 18, 2013 19:37
-
-
Save sportebois/7046921 to your computer and use it in GitHub Desktop.
Detect if you're using an old version of Safari on iOS that do not support file upload (input="file"), i.e. if your iOS version is older than 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @return Boolean | |
*/ | |
function fileUploadIsSupported() { | |
'use strict'; | |
// Look for mobile iOS 4 or 5 | |
return !(/(iPhone|iPad|iPod)(;)?(\s\w;)?(\s)?(CPU)?(\s)?(\sOS\s)(3|4|5)/.test(navigator.userAgent)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(iPhone|iPad|iPod)(;)?(\s\w;)?(\s)?(CPU)?(\s)?(\sOS\s)(3|4|5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment