Last active
December 8, 2018 05:28
-
-
Save EddyVerbruggen/cd02c73162180793513e to your computer and use it in GitHub Desktop.
iOS8 Beta Phonegap fix: manually set the navigator.userAgent
This file contains 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
// temp fix for iOS8 beta 1 (fixed in beta 2), add it after the reference to cordova.js | |
if (navigator.userAgent === undefined) { | |
navigator.__defineGetter__('userAgent', function() { | |
return("Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, newbie question here but would this trick also affect the way Phonegap/Cordova reports its browser user agent when making external HTTP requests?
If yes, then this is a much simpler way than these suggestions:
change-phonegap-user-agent (@Stackoverflow, for IOS)
&
change-phonegap-cordova-user-agent-for-ajax (@Stackoverflow, for Android)
Of course, I do realise I could just test it out ;-)