GitHub user shazron opened a pull request:
https://github.com/apache/cordova-js/pull/80
CB-6911 - iOS 8 - "deprecated attempt to access property" errors when
accessing anything off window.navigator
Tested on iOS 8 UIWebView. Any attempt to call the bridge will result in:
"Deprecated attempt to access property 'userAgent' on a non-Navigator
object." in the console of the Web Inspector.
Object.defineProperty seems to have broad support in mobile browsers:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__#Browser_compatibility
Not sure about IE Mobile, that's why I sent this pull request for
discussion since these files are common for all platforms. The (safe)
alternative is to add this code for iOS only.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/shazron/cordova-js CB-6911
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-js/pull/80.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #80
----
commit 6c7a76fcd2f0aa60e0879d1417e1ac0ca44f2c6c
Author: Shazron Abdullah <[email protected]>
Date: 2014-09-10T02:09:28Z
CB-6911 - iOS 8 - "deprecated attempt to access property" errors when
accessing anything off window.navigator
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---