-
-
Save EddyVerbruggen/cd02c73162180793513e to your computer and use it in GitHub Desktop.
// 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"); | |
}); | |
} |
It didn't work for me. The application loads but it looks messy/disordered because the css never loads. Trying to find an alternative.. if there is any other option or proposal i would be glad to hear it. Thanx..
@JcDenton86 sounds like other iOS8 trouble than phonegap related - and that's what this fix is for, not anything else.
You are right.. JQM doesn't load as it should, but it is related to the userAgent because changing that value before loading JQM, I see diferences - but still it's not as it supposed to be.
Thanks anyway
I am using cordova with ionic and this is working like a charm .. Thank you!
I just used this fix and it works for me with Cordova 3.4.0. Note that I had to add the javascript after all of the Cordova javascript - including the plugins.
Heads up: iOS 8 beta 2 fixes the userAgent issue, so you no longer require this fix. Yippeeee!
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 ;-)
Thanks!!!