2

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?

Pang
  • 9,564
  • 146
  • 81
  • 122
Taron Mehrabyan
  • 2,199
  • 2
  • 20
  • 27

1 Answers1

3

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.

Pawel Uchida-Psztyc
  • 3,735
  • 2
  • 20
  • 41