cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piotr Zalewa <pzal...@mozilla.com>
Subject Security Error in FirefoxOS on reading window.navigator properties
Date Thu, 20 Jun 2013 12:06:54 GMT
I came to a point where I need to use the group wisdom.

In https://github.com/apache/cordova-firefoxos/blob/master/lib/cordova.firefoxos.js#L5929
Cordova is trying to replace window.navigator with something which looks like a copy of itself.
window.navigator is protected in FirefoxOS - even browsing through its properties is not allowed.

alert('pre'); for (var key in window.navigator) {window.navigator[key]}; alert('post');

Above code will work in browser, but not on the device or Simulator. It will throw "SecurityError:
The operation is insecure." and 'post' will not get alerted. Example in JSFiddle - http://jsfiddle.net/zalun/VkCyH/embedded/result/
(just install in Simulator)

I'm looking for a solution for that issue.

Is the step with replacing window.navigator needed? The comment in the code says 
// We replace it so that properties that can't be clobbered can instead be overridden.


Piotr

Mime
View raw message