[w3c/ServiceWorker] How does ServiceWorker interact with non-"fully active" documents? (#1594)

Currently the ServiceWorker specification does not specify how it interacts with non-"[fully active](https://html.spec.whatwg.org/multipage/browsers.html#fully-active)" (bfcached) documents/window clients.
* Iterating over all clients does not filter out window clients with non-fully active documents. Example: [Clients.get()](https://w3c.github.io/ServiceWorker/#clients-get), [Clients.matchAll()](https://w3c.github.io/ServiceWorker/#clients-matchall), [Clients.claim()](https://w3c.github.io/ServiceWorker/#clients-claim)
* Actions on window clients whose document is no longer fully active can still happen. Example: [Client.postMessage()](https://w3c.github.io/ServiceWorker/#client-postmessage)

We recommend following the [WIP guide](https://github.com/w3ctag/design-principles/pull/317#pullrequestreview-663440698) we've made on handling non-fully active documents, by adding "fully active" checks so that we won't include clients with non-fully active documents, and if necessary trigger discarding of the document (e.g. for Clients.claim()). This is already how it behaves in Chrome's implementation of BFCache, and @hiroshige-g will also publish some WPTs soon to show how it behaves in various browsers.

cc @domenic @fergal @altimin

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1594

Received on Thursday, 20 May 2021 02:49:55 UTC