Re: [w3c/ServiceWorker] Add an option to include frozen documents. (#1442)

> * As explicitly stated in the initiating comment, this is not desirable from a postMessage perspective because the tasks for the client are disabled and the message payloads will stack up, effectively leaking memory.

Given a multi-process architecture, I am not sure how we can make sure that any client, believed to be frozen or unfrozen at matchAll resolution time, or postMessage call time, will not get frozen/discarded anyway before the postMessage task reaches the client.
If this is the real problem, maybe we should fix it at postMessage(), navigate(), openWindow()... level.

Also, I am not sure the concept of a discarded service worker client makes total sense since it is more related with the concept of a page. Is there any use in knowing whether iframe clients or worker clients are discarded for instance?

I get it that one might want to optimize the number of opened tabs.
There are a few caveats though. At least in Safari, a private browsing tab is in a different session than another private browsing tab. These tabs will have different service workers, even though the user might see these as the same web site.

When launching a browser, tabs might be visible but pages are not loaded.
Exposing information of these tabs to a service worker is exposing state information that might persist, even if for instance user decides to clear all website data (cookies, IDB...) before launching the browser.

> It seems to make sense to be, but I don't know how other browsers feel about page lifecycle.

I'll try to get some feedback from Safari people.
My initial reaction is that this might not be a highly desirable feature.
If a tab gets frozen to preserve battery, why fire an event that will end up executing JS thus decrease the battery life and potentially allow the page to try not being frozen?
This might also be difficult to implement consistently.

-- 
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/pull/1442#issuecomment-511573439

Received on Monday, 15 July 2019 21:17:38 UTC