I am trying to utilise web workers in a webOS for signage application due to an odd bug where times between executing file downloads using the SCAP API slows down exponentially.
My idea was to try web workers to download the files, hopefully meaning the issue would go away/the app would be a bit snappier.
However, the SCAP API is based on Cordova and its seems Cordova needs to access the Window object, something a Web Worker cannot do it seems (I finally found out after hours of trying!)
My question is, is there anyway at all to get a web worker to work in conjunction with Cordova?
Are there any other types of workers that can access the window object?
Basically, is there any solution to this at all? Or is it 100% impossible and futile to attempt?
Worker
s cannot directly reach awindow
, ever. you might be able to rewrite the API calls to not use anything that's window-only. you could download in a worker using ajax, and the transfer the blob viapostMessage()
towindow
at the last moment to download it to the OS. – Posewindow.open()
,msSaveBlob()
, ora[download].click()
... you might be able to create a cordova app that runs in the background and only downloads stuff, when the other app tells it to. – Pose