Intent to Ship: Request.isHistoryNavigation

58 views
Skip to first unread message

Yutaka Hirano

unread,
Jun 4, 2018, 11:47:23 PM6/4/18
to blink-dev

Contact emails

yhi...@chromium.org


Explainer / Summary

This is a boolean property introduced on Request class. It represents whether the request is made for a history navigation (by back / forward button, for example). This is generally used in a service worker.


See https://github.com/w3c/ServiceWorker/issues/1167 for the design discussion.


Design doc/Spec

https://fetch.spec.whatwg.org/#dom-request-ishistorynavigation

https://github.com/w3ctag/design-reviews/issues/289


Motivation

This allows a service worker to know whether a request was due to a back/forward navigation. For example, it might more heavily use cached responses on such a navigation.


Risks

Interoperability and Compatibility

Edge/Firefox/Safari: We talked about the idea with people from Edge/Firefox/Safari at a ServiceWorker F2F and got agreement (though the actual interface is slightly different from that one).

Web developers: Google Search has requested this.


Ergonomics

> Are there any other platform APIs this feature will frequently be used in tandem with?

ServiceWorker, History API

> Could the default usage of this API make it hard for Chrome to maintain good performance (i.e. synchronous return, must run on a certain thread, guaranteed return timing)?

No.


Activation

Easy: it's a simple API surface with generic and PWA use cases.


Some notes:

 - There are some related flags proposed altogether (isReloadNavigation / isFormSubmission). We are going to implement and ship isHistoryNavigation first based on customer requests.

 - Whether to persist this flag to CacheStorage is under discussion. But that issue is not specific to this property, and I don't think it should block this intent to ship.


Debuggability

No special support is required.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Is this feature fully tested by web-platform-tests?

Yes.


See https://github.com/w3c/web-platform-tests/pull/10909 (followed up by https://github.com/web-platform-tests/wpt/pull/11220).


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/4668970653188096


Requesting approval to ship?

Yes


Philip Jägenstedt

unread,
Jun 5, 2018, 4:42:59 AM6/5/18
to Yutaka Hirano, blink-dev
LGTM1. Looks like the bit that sets the flag is in https://html.spec.whatwg.org/#history-traversal.

https://wpt.fyi/results/fetch/api/request/request-reset-attributes.https.html and https://wpt.fyi/results/fetch/api/request/request-reset-attributes.https.html?label=experimental confirm that nobody else supports this yet. Can you please be sure to file bugs with the other browsers about supporting this, noting that it will ship in Chrome? Hopefully that'll shorten the time until it's available everywhere. (Linking to those bugs in the spec issue is also nice.)

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABihn6EGbb1EX8XHteGiUxUYubgYPDB4rTPqgoU75-52PcD57g%40mail.gmail.com.

Yoav Weiss

unread,
Jun 5, 2018, 9:38:41 AM6/5/18
to Philip Jägenstedt, Yutaka Hirano, blink-dev
On Tue, Jun 5, 2018 at 10:42 AM 'Philip Jägenstedt' via blink-dev <blin...@chromium.org> wrote:
LGTM1. Looks like the bit that sets the flag is in https://html.spec.whatwg.org/#history-traversal.

https://wpt.fyi/results/fetch/api/request/request-reset-attributes.https.html and https://wpt.fyi/results/fetch/api/request/request-reset-attributes.https.html?label=experimental confirm that nobody else supports this yet. Can you please be sure to file bugs with the other browsers about supporting this, noting that it will ship in Chrome? Hopefully that'll shorten the time until it's available everywhere. (Linking to those bugs in the spec issue is also nice.)

On Tue, Jun 5, 2018 at 5:47 AM Yutaka Hirano <yhi...@chromium.org> wrote:

Contact emails

yhi...@chromium.org


Explainer / Summary

This is a boolean property introduced on Request class. It represents whether the request is made for a history navigation (by back / forward button, for example). This is generally used in a service worker.


See https://github.com/w3c/ServiceWorker/issues/1167 for the design discussion.


Design doc/Spec

https://fetch.spec.whatwg.org/#dom-request-ishistorynavigation

https://github.com/w3ctag/design-reviews/issues/289


Motivation

This allows a service worker to know whether a request was due to a back/forward navigation. For example, it might more heavily use cached responses on such a navigation.


Risks

Interoperability and Compatibility

Edge/Firefox/Safari: We talked about the idea with people from Edge/Firefox/Safari at a ServiceWorker F2F and got agreement (though the actual interface is slightly different from that one).


Was there also agreement on the latest design from other vendors?

Do you know if other vendors intend to ship this as well?
Were there issues opened on them as part of the spec/WPT changes?
 
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAARdPYcxxW4SUU2SgByzvSZUP6WGteHMt0qyk23TPQ%2BVFgibwQ%40mail.gmail.com.

Yutaka Hirano

unread,
Jun 6, 2018, 12:01:12 AM6/6/18
to Yoav Weiss, Philip Jägenstedt, blink-dev, Benjamin Kelly
On Tue, Jun 5, 2018 at 10:38 PM Yoav Weiss <yo...@yoav.ws> wrote:


On Tue, Jun 5, 2018 at 10:42 AM 'Philip Jägenstedt' via blink-dev <blin...@chromium.org> wrote:
LGTM1. Looks like the bit that sets the flag is in https://html.spec.whatwg.org/#history-traversal.

https://wpt.fyi/results/fetch/api/request/request-reset-attributes.https.html and https://wpt.fyi/results/fetch/api/request/request-reset-attributes.https.html?label=experimental confirm that nobody else supports this yet. Can you please be sure to file bugs with the other browsers about supporting this, noting that it will ship in Chrome? Hopefully that'll shorten the time until it's available everywhere. (Linking to those bugs in the spec issue is also nice.)

On Tue, Jun 5, 2018 at 5:47 AM Yutaka Hirano <yhi...@chromium.org> wrote:

Contact emails

yhi...@chromium.org


Explainer / Summary

This is a boolean property introduced on Request class. It represents whether the request is made for a history navigation (by back / forward button, for example). This is generally used in a service worker.


See https://github.com/w3c/ServiceWorker/issues/1167 for the design discussion.


Design doc/Spec

https://fetch.spec.whatwg.org/#dom-request-ishistorynavigation

https://github.com/w3ctag/design-reviews/issues/289


Motivation

This allows a service worker to know whether a request was due to a back/forward navigation. For example, it might more heavily use cached responses on such a navigation.


Risks

Interoperability and Compatibility

Edge/Firefox/Safari: We talked about the idea with people from Edge/Firefox/Safari at a ServiceWorker F2F and got agreement (though the actual interface is slightly different from that one).


Was there also agreement on the latest design from other vendors?
wanderview@ (Mozilla) reviewed isReloadNavigation spec change and tests, and isHistoryNavigation tests.
 
Do you know if other vendors intend to ship this as well?
No.

Were there issues opened on them as part of the spec/WPT changes?

Yoav Weiss

unread,
Jun 6, 2018, 12:18:27 AM6/6/18
to Yutaka Hirano, Philip Jägenstedt, blink-dev, Benjamin Kelly
LGTM2

On Wed, Jun 6, 2018 at 6:01 AM Yutaka Hirano <yhi...@chromium.org> wrote:
On Tue, Jun 5, 2018 at 10:38 PM Yoav Weiss <yo...@yoav.ws> wrote:


On Tue, Jun 5, 2018 at 10:42 AM 'Philip Jägenstedt' via blink-dev <blin...@chromium.org> wrote:
LGTM1. Looks like the bit that sets the flag is in https://html.spec.whatwg.org/#history-traversal.

https://wpt.fyi/results/fetch/api/request/request-reset-attributes.https.html and https://wpt.fyi/results/fetch/api/request/request-reset-attributes.https.html?label=experimental confirm that nobody else supports this yet. Can you please be sure to file bugs with the other browsers about supporting this, noting that it will ship in Chrome? Hopefully that'll shorten the time until it's available everywhere. (Linking to those bugs in the spec issue is also nice.)

On Tue, Jun 5, 2018 at 5:47 AM Yutaka Hirano <yhi...@chromium.org> wrote:

Contact emails

yhi...@chromium.org


Explainer / Summary

This is a boolean property introduced on Request class. It represents whether the request is made for a history navigation (by back / forward button, for example). This is generally used in a service worker.


See https://github.com/w3c/ServiceWorker/issues/1167 for the design discussion.


Design doc/Spec

https://fetch.spec.whatwg.org/#dom-request-ishistorynavigation

https://github.com/w3ctag/design-reviews/issues/289


Motivation

This allows a service worker to know whether a request was due to a back/forward navigation. For example, it might more heavily use cached responses on such a navigation.


Risks

Interoperability and Compatibility

Edge/Firefox/Safari: We talked about the idea with people from Edge/Firefox/Safari at a ServiceWorker F2F and got agreement (though the actual interface is slightly different from that one).


Was there also agreement on the latest design from other vendors?
wanderview@ (Mozilla) reviewed isReloadNavigation spec change and tests, and isHistoryNavigation tests.

That seems like a good signal. In the unlikely event that we'd need to change the design after shipping, seems like developers would have to handle `Request.isHistoryNavigation` being undefined (to support browsers which haven't shipped it yet), so unshipping won't cause breakage.
 
 
Do you know if other vendors intend to ship this as well?
No.

Were there issues opened on them as part of the spec/WPT changes?

Great, thanks.

Rick Byers

unread,
Jun 6, 2018, 4:46:42 PM6/6/18
to Yutaka Hirano, Yoav Weiss, Philip Jägenstedt, blink-dev, Benjamin Kelly
Reply all
Reply to author
Forward
0 new messages