New issue
Advanced search Search tips

Issue 704658 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

Service Workers: `Client` object's URL property does not describe "creation URL"

Reported by m...@mikepennisi.com, Mar 23 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36

Steps to reproduce the problem:
1. Use `history.pushState` to change the current document's URL
2. From a ServiceWorker, retrieve a Client instance representing the client
   used to complete step 1
3. Inspect the `url` property of the Client instance

What is the expected behavior?
The value should be the client's original URL

What went wrong?
The value is the modified URL

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.19  Channel: dev
OS Version: 
Flash Version: 

The `url` property of each `Client` instance should describe the "creation URL"
[1] of that environment, which is not susceptible to modification through, e.g.
the `history.pushState` API [2]. A test in Web Platform Tests verifies this,
but it is currently disabled (previously reported simply as a "test timeout")
[4].

[1] https://w3c.github.io/ServiceWorker/#client-url

> ## 4.2.1. url
>
> The url attribute must return the context object’s associated service worker
> client's serialized creation URL.

[2] https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-creation-url

> ## A creation URL
>
> An absolute URL that represents the location of the resource with which the
> environment is associated.
>
> Note: In the case of an environment settings object, this URL might be
> distinct from the environment settings object's responsible document's URL,
> due to mechanisms such as history.pushState().

[3] https://github.com/w3c/web-platform-tests/blob/8bb0b769af8d7a6d245db31c0b6029eb3b7da861/service-workers/service-worker/resources/clients-matchall-client-types-iframe.html#L3-L7
[4] https://chromium.googlesource.com/chromium/src.git/+/92c1a4cf87397d9a63c6e1bc0bb6ecc141a0979c/third_party/WebKit/LayoutTests/TestExpectations#2322
 

Comment 1 by bke...@mozilla.com, Mar 23 2017

Overall I think this issue is correct and Client.url should not reflect things like pushState().  I just want to note, though, that the spec is a bit confusing when it comes to creation URL.  I went through a lot of this last night and wrote some spec issues:

https://github.com/whatwg/html/issues/2455
https://github.com/whatwg/html/issues/2456
https://github.com/w3c/ServiceWorker/issues/1091

Just FYI in case you try reading through those specs and get confused like I did.
What a coincidence! Thanks, Ben :)
Cc: rbasuvula@chromium.org
Labels: TE-NeedsTriageHelp
This looks like out of scope for TE(Service Worker related), hence adding the respective label for it to  triage further.

Comment 4 by falken@chromium.org, Mar 31 2017

Labels: -Pri-2 Pri-3
Status: ExternalDependency (was: Unconfirmed)
Sounds blocked on:
https://github.com/whatwg/html/issues/2455
https://github.com/whatwg/html/issues/2456
https://github.com/w3c/ServiceWorker/issues/1091 

Sign in to add a comment