Do not try to replace window.navigator#215
Conversation
window.navigator is a read-only property. Thus the current code for replacing it cannot succeed in a [spec][1] compliant browser. In strict mode the attempt will throw an error. In sloppy mode, the one Cordova is currently running in, the attempt is silently ignored. Since apps seem to have been doing OK with the original navigator object we should just remove the code trying to replace it. [1]: https://html.spec.whatwg.org/multipage/window-object.html#the-window-object
After these changes, is using https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode |
|
@breautek I'd be definitely in favor of enabling strict mode in the future. |
window.navigatoris a read-only property. Thus the current code for replacing it cannot succeed in a spec compliant browser. In strict mode the attempt will throw an error. In sloppy mode, the one Cordova is currently running in, the attempt is silently ignored.Since apps seem to have been doing OK with the original
Navigatorobject we should just remove the code trying to replace it.