Skip to content

Commit

Permalink
CB-6911 - iOS 8 - "deprecated attempt to access property" errors when…
Browse files Browse the repository at this point in the history
… accessing anything off window.navigator
  • Loading branch information
shazron committed Sep 10, 2014
1 parent 1258511 commit 6c7a76f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/common/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ function replaceNavigator(origNavigator) {
for (var key in origNavigator) {
if (typeof origNavigator[key] == 'function') {
newNavigator[key] = origNavigator[key].bind(origNavigator);
} else {
(function(k) {
Object.defineProperty(newNavigator, k, {
get: function() {
return origNavigator[k];
},
configurable: true,
enumerable: true
});
})(key);
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/common/init_b.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ function replaceNavigator(origNavigator) {
for (var key in origNavigator) {
if (typeof origNavigator[key] == 'function') {
newNavigator[key] = origNavigator[key].bind(origNavigator);
} else {
(function(k) {
Object.defineProperty(newNavigator, k, {
get: function() {
return origNavigator[k];
},
configurable: true,
enumerable: true
});
})(key);
}
}
}
Expand Down

0 comments on commit 6c7a76f

Please sign in to comment.