No is working on this that I know of. XHRs from a worker would likely kick the native bridge fine, so long as the user-agent of the worker is set correctly.
Problem is that the native side does a stringByEvaluatingStringFromString to retrieve the payload of the exec() command, as well as to send responses. Probably the best way to implement this would be to have exec() from the worker use postMessage() to route them via the main window. On Wed, Feb 12, 2014 at 7:51 PM, Christian G. Warden <[email protected]>wrote: > Will XHRs to gap_exec within a web worker already be intercepted by > cordova, or do both the native and javascript sides need to be updated > to support calling cordova APIs from within a web worker? > > In either case, has any progress been made on this in a public repo? > > Thanks, > Christian > > On Wed, Dec 11, 2013 at 02:08:54PM +1000, Brian LeRoux wrote: > > I'm getting into a refactor of cordova.js and will keep this in mind > while > > I'm in there. Like Andrew says things are somewhat coupled at the moment > > but that doesn't mean it has to be. > > > > > > On Wed, Dec 11, 2013 at 12:17 PM, Andrew Grieve <[email protected] > >wrote: > > > > > It could be made to work, but would certainly require some effort. > > > > > > > > > On Tue, Dec 10, 2013 at 2:32 PM, Michael Gauthier < > [email protected] > > > >wrote: > > > > > > > Is it possible to use cordova inside a web worker? I tried importing > the > > > > cordova script but it makes reference to 'window' which is forbidden > in > > > > web-worker context. > > > > > > > > It would be useful to be able to call cordova functions from within > a web > > > > worker. > > > > > > > > Cheers, > > > > Mike > > > > > > > >
