I have some metadataWorker.js
in my Chrome App, It is Web Worker and runs as follows:
metaThread = new Worker('/src/utils/metadataworker.js');
But I can't access the chrome
global object in metadataworker.js
.
Is there any way to use Chrome API (access the chrome
global object) in Web Worker?
You can't access chrome object from web worker. This is sandboxed from the app and it run in separate thread. You can only use web APIs inside a web worker, without DOM access.