New issue
Advanced search Search tips

Issue 642413 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

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
 
The chrome.stroage API is for extensions. Are you using a web worker inside an extension? Is that what you are saying?

If this is just a normal page what documentation have you consulted that indicates the chrome API can be accessed in normal pages.
Cc: dtapu...@chromium.org

Comment 3 by shlat...@gmail.com, 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.
Cc: -dtapu...@chromium.org
Components: Blink>Workers

Comment 5 by falken@chromium.org, Sep 12 2016

Components: Platform>Extensions Platform>Apps
Owner: rdevlin....@chromium.org
rdevlin: Can you triage this? Is this a known issue? Presumably apps and extensions would work the same.
Cc: rdevlin....@chromium.org
Owner: lazyboy@chromium.org
Status: Assigned (was: Unconfirmed)
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