You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jim Mont (JIRA)" <ji...@apache.org> on 2016/02/01 08:40:39 UTC

[jira] [Created] (CB-10492) File System API missing in web workers

Jim Mont created CB-10492:
-----------------------------

             Summary: File System API missing in web workers
                 Key: CB-10492
                 URL: https://issues.apache.org/jira/browse/CB-10492
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin File
         Environment: all
            Reporter: Jim Mont


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:
{code:javascript}
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');
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org