New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 661071 link

Starred by 8 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Launch-OWP
Launch-Accessibility: ----
Launch-Exp-Leadership: ----
Launch-Leadership: ----
Launch-Legal: ----
Launch-M-Approved: ----
Launch-M-Target: 57-Dev , 57-Beta , 57-Stable-Exp
Launch-Privacy: Yes
Launch-Security: ----
Launch-Test: Yes
Launch-UI: ----
Rollout-Type: ----



Sign in to add a comment

OWP Launch: Service Worker navigation preload

Project Member Reported by falken@chromium.org, Nov 1 2016

Issue description

This is the OWP launch bug only. See the implementation bug at  Issue 649558 . 

Chrome status: https://www.chromestatus.com/feature/5734842339688448
Intent to implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/PI3FG54L1ZU/B4jNSzhyCAAJ

Change description:
An API that enables the browser to send “preload” network requests for navigations before executing the fetch event handler in the service worker that intercepts the target URL.

Changes to API surface:
- NavigationPreloadManager interface
- ServiceWorkerRegistration.navigationPreload object
- FetchEvent.preloadResponse object

Links:
Public standards discussion: https://github.com/w3c/ServiceWorker/issues/920

Support in other browsers:
Internet Explorer: Positive signals
Firefox: Positive signals
Safari: Positive signals

*Make sure to fill in any labels with a -?, including all OSes this change
affects. Feel free to leave other labels at the defaults.

 
Description: Show this description
Description: Show this description

Comment 3 by falken@chromium.org, Jan 11 2017

Cc: mkwst@chromium.org
Labels: -Pri-3 Launch-M-Target-57-Dev Launch-M-Target-57-Beta Launch-M-Target-57-Stable-Exp Launch-Status-Review-Requested Pri-2
Status: Started (was: Assigned)
I'm aiming to start an Origin Trial in M57. Could Security and Privacy folks give feedback?

This is a minor API addition to service workers, that allows a site to opt-in to a "preload navigation" optimization.
Here is some sample code: https://mattto.github.io/sw/demo/navigation-preload/

Without this enabled, when you navigate to a URL in a service worker's scope, the following occurs:
1. Dispatch a 'fetch' event to the service worker.
2. If the service worker did not respond to the request, send the network request as usual.

With this enabled, the following occurs:
1a. Send a "preload" network request (same as the normal request, with a special header "Service-Worker-Navigation-Preload").
1b. Simultaneously dispatch the 'fetch' event to the service worker. In the fetch event, the service worker has access to the preload response via a Promise API.
2. If the service worker did not respond to the request, send the network request as usual.

From a security and privacy standpoint, probably the only interesting bit is the new Service-Worker-Navigation-Preload header. The header value defaults to "true" and the author can customize it using the Navigation Preload API. This enables a use case such as setting the header value to the "most recent post read/cached" so the server responds with fresh data that is not cached client-side. Then the service worker can respond with the cached data and stream in the fresh data from the preload response.
Cc: msramek@chromium.org
If I understand correctly, the network communication this results in is equivalent to:

1. Navigate to a URL in the SW's scope with a parameter "?preload=value".
2. Parse this parameter in the fetch() handler and send a network request with the custom header "Service-Worker-Navigation-Preload: value".
3. respondWith(response from #2)

...which can be done today. Preload just changes the timing. Is that right?

In step #2, the service worker could call fetch() with or without cookies. Preload doesn't know which it would be, and therefore only works if cookies are enabled? (You mentioned that would be the case in the email thread, I just want to confirm that it's still true and that this is the rationale).

Are there any other notable differences between the preload network request and the network request that would be done by the SW in step #2?

Comment 5 by falken@chromium.org, Jan 17 2017

Yes, your steps 1-3 can be done today and navigation preload just changes the timing.

Regarding cookies, independent of navigation preload, service workers are only allowed if cookies are allowed (I think this is the same as all web storage APIs, cf bug 419277). If cookies are blocked, the service worker won't run and we don't do navigation preload. So that's all is meant by navigation preload only works if cookies are allowed.

So if cookies are disabled, you can't do steps 1-3 either. Step 1 would bypass any service worker.

I can't think of any difference between steps 1-3 other than timing.
Labels: Launch-Privacy-Yes
Thanks for the clarification. Then I don't see any privacy delta.
falken@, Please provide the following information, so that chrome test engineering team can proceed with testing.

1. Is the feature code complete & enabled in the trunk and ready for testing?
2. Does this require manual testing?
3. Any specific setup / flags required?
4. Do we have enough UMA coverage to measure the stability? Its highly recommend always adding Stability.Counts and CrashExitCodes.* to your json to measure stability of your experiment.

Thank you!

Comment 8 by falken@chromium.org, Jan 18 2017

Hi manoranjanr@:

1. We're launching this as an Origin Trial first. So it's code complete but not enabled on trunk without a command-line flag or Origin Trial token.

2. No, this is a Web Platform API and I think traditionally we don't do manually testing for those. We have LayoutTests and unit tests to exercise the API.

3. Yes, you need to use --enable-features=ServiceWorkerNavigationPreload or else use the Origin Trial system once that is launched.

4. This isn't a Finch experiment; it's an Origin Trial so there is no experiment json. We regularly triage crashes with "service worker" or "worker" in the crash stacks, so this would be covered by that.
Labels: Launch-Test-Yes
falken@, thank you so much for the update. Flipping 'Launch-Test = Yes" as there is no manual testing is required.
Service Worker Navigation Preload is available as an Origin Trial: if you want to experiment with us, apply for a token at https://bit.ly/OriginTrialSignup
Project Member

Comment 11 by bugdroid1@chromium.org, Apr 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b

commit 23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b
Author: horo <horo@chromium.org>
Date: Thu Apr 13 03:29:24 2017

Enable ServiceWorkerNavigationPreload by default

Intent to experiment:
 https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/0-6bmy1cOnw
Intent to ship:
 https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/d8KxOilsS2g
OWP launch tracking bug:
 https://bugs.chromium.org/p/chromium/issues/detail?id=661071
Feature dashboard:
 https://www.chromestatus.com/feature/5734842339688448

BUG= 661071 

Review-Url: https://codereview.chromium.org/2811063002
Cr-Commit-Position: refs/heads/master@{#464276}

[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/content/browser/service_worker/service_worker_dispatcher_host.cc
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/content/browser/service_worker/service_worker_fetch_dispatcher.cc
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/content/browser/service_worker/service_worker_version.cc
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/content/browser/service_worker/service_worker_version.h
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/content/child/runtime_features.cc
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/content/public/common/content_features.cc
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/testing/variations/fieldtrial_testing_config.json
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/VirtualTestSuites
[add] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/resources/navigation-preload-worker.js
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/resources/navigation-preload-worker.php
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-navigation-preload.html
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/navigation-preload-origin-trial-interfaces-expected.txt
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/navigation-preload-origin-trial-interfaces.html
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/navigation-preload-origin-trial-methods-expected.txt
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/navigation-preload-origin-trial-methods.html
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/navigation-preload-origin-trial-interfaces-worker.php
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/navigation-preload-origin-trial-methods-scope.php
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/navigation-preload-origin-trial-methods-worker.php
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/chromium/navigation-preload-origin-trial-interfaces-expected.txt
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/chromium/navigation-preload-origin-trial-methods-expected.txt
[rename] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/webexposed/README.txt
[add] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[copy] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/README.txt
[add] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-dedicated-worker-expected.txt
[add] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[add] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-shared-worker-expected.txt
[delete] https://crrev.com/99571b384c472ba1a11be6bcf14ddd9de195bffe/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-wpt/external/wpt/service-workers/service-worker/navigation-preload/README.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/Source/modules/serviceworkers/FetchEvent.idl
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/Source/modules/serviceworkers/NavigationPreloadManager.idl
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.idl
[modify] https://crrev.com/23752147e6f5f7dcaf4bad1bb1c306fb91e1ec5b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5

Labels: -M-57 M-59
Status: Fixed (was: Started)
Project Member

Comment 13 by bugdroid1@chromium.org, Apr 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/08e50b34516be09c5acfeabf69d7f37c9df1cb1e

commit 08e50b34516be09c5acfeabf69d7f37c9df1cb1e
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Wed Apr 04 07:27:15 2018

ServiceWorker: Remove WebRuntimeFeatures::EnableServiceWorkerNavigationPreload()

NavigationPreload is enabled by default[1] and the function is no longer used.

[1] https://www.chromestatus.com/feature/5734842339688448

Bug:  661071 
Change-Id: I36955d9458743dc38fda0c31f6900c728b772f94
Reviewed-on: https://chromium-review.googlesource.com/989522
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548000}
[modify] https://crrev.com/08e50b34516be09c5acfeabf69d7f37c9df1cb1e/third_party/WebKit/public/platform/WebRuntimeFeatures.h

Project Member

Comment 14 by bugdroid1@chromium.org, Jul 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e956395ba71a3d226ce0b163dbe009623a02ebe

commit 7e956395ba71a3d226ce0b163dbe009623a02ebe
Author: Matt Falkenhagen <falken@chromium.org>
Date: Tue Jul 24 22:26:31 2018

Remove obsolete field trial testing configs for service worker experiments.

These have all been enabled by default client-side or removed for some time:
- PWAFullCodeCache in Chrome 67
- ServiceWorkerNavigationPreload in Chrome 59
- ServiceWorkerScriptFullCodeCache in Chrome 67
- ServiceWorkerScriptStreaming in Chrome 64
- SpeculativeLaunchServiceWorker was removed

Bug:  661071 ,  683037 ,  768705 , 640132
Change-Id: Id218f3882273063db7e4c358cac956ca54f362d8
Reviewed-on: https://chromium-review.googlesource.com/1147895
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577711}
[modify] https://crrev.com/7e956395ba71a3d226ce0b163dbe009623a02ebe/testing/variations/fieldtrial_testing_config.json

Sign in to add a comment