Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10492

File System API missing in web workers

    XMLWordPrintableJSON

    Details

      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');
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cordova-apache-issues-jimmont Jim Mont
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: