Intent to Ship: WindowClient.navigate(url) for ServiceWorker

165 views
Skip to first unread message

Jinho Bang

unread,
Oct 14, 2015, 2:49:11 AM10/14/15
to blink-dev

Contact emails

jinho...@samsung.com


Spec

http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#client-navigate


Summary

Using the api, we can make the window client navigate to specific url.

(It's possible even if the url isn't same origin.)


Adding the following method to ServiceWorkerClient.

- [NewObject] Promise<WindowClient> navigate(USVString url);


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/forum/#!search/windowclient.navigate/blink-dev/KETlHSSc878/aZJJCSNzS1sJ


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

Yes


Compatibility Risk

Low, many users is waiting for it as well as it’s already included in the service worker version 1.

Version1 ED : https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client-navigate

WD : http://www.w3.org/TR/service-workers/#client-navigate


OWP launch tracking bug

http://crbug.com/500911


Entry on the feature dashboard

http://www.chromestatus.com/features/5314750808326144

TAMURA, Kent

unread,
Oct 20, 2015, 4:07:28 AM10/20/15
to Jinho Bang, blink-dev
lgtm to ship.

--
TAMURA Kent
Software Engineer, Google


Philip Jägenstedt

unread,
Oct 20, 2015, 2:41:31 PM10/20/15
to Jinho Bang, blink-dev
Just skimming the implementation to see if it matches the spec, I see that there's a case where navigate() will return a promise rejected with SecurityError, which isn't in the spec. Should it be?

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

John Mellor

unread,
Oct 20, 2015, 3:10:22 PM10/20/15
to Philip Jägenstedt, Jinho Bang, blink-dev
What did you end up implementing for https://github.com/slightlyoff/ServiceWorker/issues/752? Is that the case Philip is talking about?

Chris Harrelson

unread,
Oct 20, 2015, 11:44:39 PM10/20/15
to John Mellor, Philip Jägenstedt, Jinho Bang, blink-dev
LGTM2

Rick Byers

unread,
Oct 21, 2015, 3:04:49 AM10/21/15
to Chris Harrelson, John Mellor, Philip Jägenstedt, Jinho Bang, blink-dev
I see this spec bug is still open for this functionality, but it looks stale - can it be closed?

LGTM3 once any substantial outstanding concerns (like the one discussed below) are resolved,

Matt Falkenhagen

unread,
Dec 8, 2015, 1:57:41 AM12/8/15
to Rick Byers, Chris Harrelson, John Mellor, Philip Jägenstedt, Jinho Bang, blink-dev, Hiroki Nakagawa
This just landed: https://codereview.chromium.org/1481753002

To close the loop, https://github.com/slightlyoff/ServiceWorker/issues/752 was closed without a spec change: navigate() on a uncontrolled client is disallowed. The implementation follows the spec.

Furthermore, it looks like the SecurityError mentioned by Philip was changed to a TypeError to match the spec: https://codereview.chromium.org/1481523006
Reply all
Reply to author
Forward
0 new messages