-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear-Site-Data: clients uncontrolled by service workers #19132
Conversation
787a13c
to
53b7aff
Compare
53b7aff
to
0954b39
Compare
df264b5
to
9826852
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lgtm, thanks.
…e directive Adds a failing test, asserting that pages actively controlled by a service worker become uncontrolled after the Clear-Site-Data storage directive. We agreed on this behavior in a spec issue and confirmed the need for this test at the TPAC Service Workers F2F. w3c/ServiceWorker#614 F2F notes: https://docs.google.com/document/d/1_Qfw5m3BJEaL1xIzTJd41HXjgJ9gq7mroBDXqSJIzic/edit
@mattto I haven't worked with this code for a while, so I don't think I have much to add beyond your code review. I'm not sure what you mean by the spec update though; the Clear-Site-Data spec already states that "Service Workers registered for an origin are terminated and deregistered." |
@msramek thanks for chiming in. I believe @mattto is talking about updating the normative part of the spec, which only says to call unregister(), which does not terminate the worker or uncontrol clients. I'm assuming you are quoting the non-normative goals section of the Clear-Site-Data spec. So really the required spec change is just about updating the normative section to reflect the already stated non-normative goals, which you pointed out. |
Ah, right. Makes sense. The Chromium implementation actually already works that way; it directly erases the service worker from the storage, instead of just going through the JavaScript codepath of calling |
@msramek the new tests added in this PR do not pass in Chrome. Which suggests that either the tests are incorrect, or Chromium doesn’t actually remove the service worker immediately. My local manual testing shows that the service worker still responds to requests on any page that was open when CSD was delivered. |
Firefox/Gecko bug to make the test happy: https://bugzilla.mozilla.org/show_bug.cgi?id=1589814 |
Adds a failing test, asserting that pages actively controlled by a service worker become uncontrolled after the Clear-Site-Data storage directive.
We agreed on this behavior in a spec issue and confirmed the need for this test at the TPAC Service Workers F2F.
w3c/ServiceWorker#614
F2F notes: https://docs.google.com/document/d/1_Qfw5m3BJEaL1xIzTJd41HXjgJ9gq7mroBDXqSJIzic/edit