Hello everyone. I have some problems with Web workers in javascript. I would like to open sqlite database from worker and make sync, but it always ends up with error: Can't find variable: openDatabase
Here is my code
//index.html
new Worker(worker.js)
//worker.js
openDatabase(...)
Why worker doesn't have permissions to openDatabase method? I tried the same with alert() method and got the same error. I know I can use importScripts() method to load some external files but I want to use global javascript method.
So is there a way how to solve this problem? Or I can't do anything more complicated in workers? Thank you for your help