-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add new strings for notRestoredReason for SharedWorker #12086
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
base: main
Are you sure you want to change the base?
Add new strings for notRestoredReason for SharedWorker #12086
Conversation
|
@smaug---- @annevk @rakina could you help to review this change? |
annevk
left a comment
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.
Wrapping is incorrect. See the guidelines and previous PR of this sort.
Fixed the wrapping, sorry. |
annevk
left a comment
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.
Thanks! I'll leave this to Mozilla to okay as per the prior PRs.
| export><code>sharedworker-with-no-active-client</code></dfn>"</dt> | ||
| <dd>This <code>Document</code> was in the <span>owner set</span> of a | ||
| <code>SharedWorkerGlobalScope</code> that is not <span data-x="active needed worker">actively | ||
| needed</span>.</dd> |
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.
I can't understand this. How is this a blocking reason?
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.
When all clients enter BFCache, the SharedWorker is no longer actively needed. The User Agent might choose to terminate the worker to prevent resource waste and potential privacy risks associated with keeping it alive indefinitely.
Since this termination breaks the connections held by the BFCached clients, we must evict them to prevent restoring pages in a broken state. (Ideally, the SharedWorker would be frozen in this case to allow clients to remain in BFCache.)
The existing
sharedworkerstring in notRestoredReason is a general back/forward cache block for pages with SharedWorker. To relax this, we are adding two specific strings:sharedworker-message: Evicts a page from back/forward cache if it receives a message from its SharedWorker while cached.sharedworker-with-no-active-client: Blocks or evicts a page if its connected SharedWorker no longer has active client. This ensures workers do not continue running without any active documents.(See WHATWG Working Mode: Changes for more details.)
/nav-history-apis.html ( diff )