Chrome App's worker doesn't contain chrome API.
Reported by
diskoncl...@gmail.com,
Aug 30 2016
|
|||||
Issue description
UserAgent: Mozilla/5.0 (X11; CrOS armv7l 8530.69.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.81 Safari/537.36
Platform: 8530.69.0 (Official Build) beta-channel veyron_speedy
Steps to reproduce the problem:
1. Create a new worker with "var myWorker = new Worker('workercode.js');"
2. Call Chrome API method such as "chrome.storage.local.clear()" inside "workercode.js".
3. Receive an error that "chrome isn't defined".
What is the expected behavior?
"chrome.storage.local.clear()" should execute correctly.
What went wrong?
Uncaught ReferenceError: chrome is not defined
Did this work before? N/A
Chrome version: 53.0.2785.81 Channel: beta
OS Version: 8530.69.0
Flash Version: Shockwave Flash 22.0 r0
,
Sep 9 2016
,
Sep 9 2016
As I indicated in the title, this is a Chrome App. I am using a web worker inside my background.js file.
,
Sep 10 2016
,
Sep 12 2016
rdevlin: Can you triage this? Is this a known issue? Presumably apps and extensions would work the same.
,
Sep 12 2016
lazyboy@ is working on exposing chrome APIs to ServiceWorkers, but I don't think that will expose them to general web workers. If it doesn't, I don't think this is something we'll address in the near future, since the complexity of exposing chrome APIs in different JS contexts is pretty high, but -> lazyboy to comment. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Sep 9 2016