You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also on Chrome (73.0.3683.103) it appears the success callback is never called:
constcallIndexedDB=greenlet(async(limit)=>{vardb;varrequest=indexedDB.open("MyTestDatabase");request.onerror=function(event){alert("Why didn't you allow my web app to use IndexedDB?!");};request.onsuccess=function(event){console.log("Success!");// Never called};});
Let me know if there's any other information I can provide that might be useful here.
Hiya - this is correct, since Greenlet workers do not have an origin. Even if IndexedDB was accessible from the greenlet function context, it would be a different database than would be accessible in the parent document. This is true for the current Data URL -based implementation, but also for the upcoming switch (back) to Blob URLs.
Unfortunately, the only way to correct this behaviour is to produce an actual file/URL that contains the worker code, which means getting into build process stuff and that's not library territory. For that the only solution I have is workerize-loader which is Webpack-specific.
Reacted by James Milner, Zbigniew Zagórski and Sukka
Activity
developit commentedon Oct 1, 2019
Hiya - this is correct, since Greenlet workers do not have an origin. Even if IndexedDB was accessible from the greenlet function context, it would be a different database than would be accessible in the parent document. This is true for the current Data URL -based implementation, but also for the upcoming switch (back) to Blob URLs.
Unfortunately, the only way to correct this behaviour is to produce an actual file/URL that contains the worker code, which means getting into build process stuff and that's not library territory. For that the only solution I have is workerize-loader which is Webpack-specific.