Re: Security Error in FirefoxOS on reading window.navigator properties

2013-08-09 Thread Richard Sentino
Hi Andrew Thanks for the feedback I'm trying to spin my head right around but IMHO I'd go with option #1 and let these plugin do whatever they want with the navigator, great advantage for 3rd party plugins that interacts with certified-only APIs [1] - although others might have a better opinio

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-08-08 Thread Andrew Grieve
I think it makes sense to have this be an option since it's breaking ff. I think it's actually only required now by the cordova-plugin-network-information plugin. 1. Maybe we could just move it into that plugin? 2. Or, we could make it a separate plugin that others wanting to override navigator s

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-08-08 Thread Richard Sentino
Hello I just wanted to keep the ball rolling about this issue. In response to "SecurityError be caught in an try{} block?", yes and it seems to do the trick. At the moment, out of the FirefoxOS-specific APIs it gets stuck in the mud at "mozTime" [1] which is only available to certified apps [2]

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-06-24 Thread Andrew Grieve
We also used this to implement navigator.connection. Without this, we can't replace the connection property. Another example is the onLine property for Android. It needs to be overridden to hide the fact that it is toggled on/off by our exec() bridge. On Mon, Jun 24, 2013 at 3:59 PM, Gord Tanner

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-06-24 Thread Gord Tanner
This might be a bad example since most platforms support native geolocation now but I know we would run into problems with: navigator.geolocation = require('cordova/plugin/geolocation') When geolocation already existed on navigator it would throw a security exception (or just be a noop). It

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-06-24 Thread Brian LeRoux
But wait, and I'm serious here, why even duck punch navigator to begin with? I understand we add properties to it. Is that why it needs to be opened? On Mon, Jun 24, 2013 at 11:50 AM, Ian Clelland wrote: > Can the SecurityError be caught in an try{} block? If so, then we could > implement a gene

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-06-24 Thread Ian Clelland
Okay, I just re-read the original "cannot even iterate over its properties" catch. So we'd need a list of named properties to copy in the second case :( (What are they attempting to do by blocking iteration on that object, anyway?) On Mon, Jun 24, 2013 at 2:50 PM, Ian Clelland wrote: > Can the

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-06-24 Thread Ian Clelland
Can the SecurityError be caught in an try{} block? If so, then we could implement a general solution of "try to clobber the entire object; if that doesn't work, try to clobber each of its properties instead." In the second case, a debug log line for each property that cannot be copied would give u

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-06-24 Thread Gord Tanner
This is from the bootstrap file for all platforms [1]. This is to cover us for security issues we were having on other platforms where we are not able to replace existing navigator object methods (geolocation, etc) or add new ones. We create this object and proxy to the original navigator object

Re: Security Error in FirefoxOS on reading window.navigator properties

2013-06-24 Thread Brian LeRoux
I'm at a loss why that code even needs to exist. Anyone? Herm / Gord? On Thu, Jun 20, 2013 at 5:06 AM, Piotr Zalewa wrote: > 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 tryi

Security Error in FirefoxOS on reading window.navigator properties

2013-06-20 Thread Piotr Zalewa
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 bro