Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
all
Description
All File system APIs (provided by cordova-plugin-file) appear to be missing in web workers. Oddly I can make XMLHttpRequests of the filesystem with file urls in workers.
In the main view running the following suggests there is no access to the filesystem directly:
var blob = new Blob(["onmessage = function(e) { var res, fn, msg; try{ fn = new Function(e.data); res = fn(); msg = JSON.stringify(res); }catch(err){ msg = JSON.stringify(err); }; postMessage(msg+' <> '+fn); }"]); var blobURL = window.URL.createObjectURL(blob); var worker = new Worker(blobURL); worker.onmessage = function(e) { console.log('worker',e) }; worker.postMessage('return 1+1'); worker.postMessage('return self.File'); worker.postMessage('return self.requestFileSystem');