New issue
Advanced search Search tips

Issue 724371 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 678905



Sign in to add a comment

Loading worker script from uncontrolled document should be intercepted by Service Worker

Project Member Reported by leon....@intel.com, May 19 2017

Issue description

On worker creation, 
  new Worker(worker_script);
If there is one SW registration for scope of worker_script, even current document is not controlled by this SW, loading worker_script request should be intercepted by this SW.

We need to get the corresponding wpt test PASS:
third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/worker-interception.https.html

 

Comment 1 by leon....@intel.com, May 19 2017

Blocking: 678905
Hi, falken@, shimazu@, I'd like to take this, do you think this is a valid task to do now? Or some hints? Thanks.

Comment 2 by leon....@intel.com, May 19 2017

Actually I'm confused about this behavior. 
My understanding is that the SW with a scope 'worker_script' should be responsible to intercept fetch events fired from the worker 'worker_script', but the test asserts that the SW should intercept the fetch for 'worker_script' script itself? Is there spec describing such behavior? Thanks!

Comment 3 by falken@chromium.org, May 19 2017

Thanks for discovering and filing the bug.

Yes that's what the bug is about. It wants new Worker(in-scope-url) and new SharedWorker(in-scope-url) from an uncontrolled client to be intercepted by an in-scope service worker.

The spec seems to agree. A "non-subresource request" includes not just navigations, but also requests for worker and shared worker.
https://fetch.spec.whatwg.org/#non-subresource-request

Handle Fetch is supposed to handle non-subresource requests:
https://w3c.github.io/ServiceWorker/#handle-fetch

Chromium's current implementation just intercepts navigations and resource requests from controlled clients.

However, I don't think it's a good time to work on this. Our interception code will change quite a bit in  issue 715640 . So I'd hold off on big changes in this area for now.

But I do think that in general the bugs at issue 678905 are good things to work on.

Comment 4 by bke...@mozilla.com, May 19 2017

> The spec seems to agree. A "non-subresource request" includes not just navigations, but also requests for worker and shared worker.

Agree, FWIW.

> Chromium's current implementation just intercepts navigations and resource requests from controlled clients.

Gecko has the same bug, but I'm working on fixing it.  Hopefully in the next few months.

Sign in to add a comment