I am trying to write a PhoneGap/Cordova app.
I am trying to do some of the more long running background stuff in Web Workers. However I am finding that some of the funct
Due to the fact that your Web Workers run outside of the main application thread they do not have the same access to JavaScript features as your main application does. Your workers do not have access to:
If you want your application in the UI thread to communicate with a worker you need to pass the object through the message. But since worker accepts string
, you can use JSON.parse()
or JSON.stringify()
to successfully send the object.