Issue metadata
Sign in to add a comment
|
Resources loaded via WorkerThreadableLoader not intercepted by service workers |
||||||||||||||||||||||||
Issue descriptionResources loaded via WorkerThreadableLoader are not intercepted by service workers. This means that the icons for push notifications cannot be offlined. The loading is performed from NotificationResourcesLoader, as implemented in https://codereview.chromium.org/1847863002/. There is a test that exercises this case in serviceworkerregistration-service-worker-fetch-resources.html in https://codereview.chromium.org/1909043003/. Assigning to Kinuko for triage. Are we using ThreadableLoader incorrectly, or is there maybe a bug in ThreadableLoader?
,
Apr 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c14267b65adf1fc1f1c7eebfd55355fc131b7acb commit c14267b65adf1fc1f1c7eebfd55355fc131b7acb Author: mvanouwerkerk <mvanouwerkerk@chromium.org> Date: Fri Apr 22 14:39:55 2016 Tests that notification resource requests are handled by onfetch. BUG=592188, 605917 Review URL: https://codereview.chromium.org/1909043003 Cr-Commit-Position: refs/heads/master@{#389102} [modify] https://crrev.com/c14267b65adf1fc1f1c7eebfd55355fc131b7acb/third_party/WebKit/LayoutTests/http/tests/notifications/resources/test-helpers.js [add] https://crrev.com/c14267b65adf1fc1f1c7eebfd55355fc131b7acb/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworkerregistration-document-fetch-resources.html [add] https://crrev.com/c14267b65adf1fc1f1c7eebfd55355fc131b7acb/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworkerregistration-page-notification-fetch-resources.html [add] https://crrev.com/c14267b65adf1fc1f1c7eebfd55355fc131b7acb/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworkerregistration-service-worker-fetch-resources.html
,
May 4 2016
Kinuko, could you take a look please?
,
May 9 2016
horo@, would you take a look at this?
,
May 12 2016
The network requests from the ServiceWorker shouldn't fire the fetch event in the ServiceWorker. According to the fetch spec: > https://fetch.spec.whatwg.org/#http-fetch > 5.3 HTTP fetch > 1. Let response be null. > 2. Let actualResponse be null. > 3. If request's skip-service-worker flag is unset and either request's client is null or request's client's global object is not a ServiceWorkerGlobalScope object, run these substeps: [HTML] [SW] > 1. Set response to the result of invoking handle fetch for request. [SW] > 2. ... When the ServiceWorker script calls showNotification(), the request's client's global object is the ServiceWorkerGlobalScope object. So the fetch request should not be handled in the ServiceWorker. I think the ServiceWorker script should use data URLs for icon resources.
,
May 12 2016
I'm sorry, I think there is still a problem we can solve here. It is normal for notifications to be shown from a service worker, and it's also normal to use regular urls, not data urls. If it helps, the m_skipServiceWorker is set to false on ResourceRequest [1]. Note that these are not fetches initiated directly from script, they are initiated by Chrome internally in order to load a notification's resources. Jake, do you know if this is possible within the current spec, or would we need to carve out space for this type of use case in the spec? [1] https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/network/ResourceRequest.cpp&cl=GROK&l=410
,
May 12 2016
I filed an issue on the fetch spec to clarify this: https://github.com/whatwg/fetch/issues/303
,
Oct 5 2016
Seems like this is blocked on https://github.com/whatwg/fetch/issues/303
,
Jul 4 2017
Let's track the rest of this in Issue 592188. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by mvanouwe...@chromium.org
, Apr 22 2016