> > It seems these objects aren't available to Web Workers due to > > concurrency > > issues: http://www.html5rocks.com/en/tutorials/workers/basics/#toc-enviornment-features > > > > Does anyone have an idea how to work around this issue? Thank! > > Can't the access to window.crypto and window.localStorage be made > asyncronous, by abstracting a class to access all document.* and > window.* functions?
Well you have to add all dependant js scripts to the web worker. Even if they functions are called asynchronously, they will still be executed in the worker thread. Im thinking this problem could be solved by depency injection. Namely by saving the function in a variable "var crypto = window.crypto" and then passing these function pointers into the constructor of openpgp.js. This way the javascript does not need knowledge of the window object. Do you think this could work? Tankred
_______________________________________________ http://openpgpjs.org

