-
Notifications
You must be signed in to change notification settings - Fork 315
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
Should the active worker move to environment settings object? #811
Comments
@domenic should probably weigh in, but I think that any state should be stored on the document. The global is not a great place because it does not change during navigation, as you noted. |
Then what do we do with workers? I don't think we're adding an unnecessary state. If that's still not desired, I guess at least we need a new client definition that holds necessary info for fetch and sw. What was the reason that environment settings object's lifetime is tied to the entire browsing context's lifetime by the way? |
For workers it's fine to use the global object. I'm not saying the state is unnecessary, I'm just saying to put it on documents when the global is Window, and on the global elsewhere. (And the reason the Window global is so messed up, not sure. Largely history at this point. We should probably explain that a bit somewhere if we haven't already.) |
Going to resolve in favor of Client changes #870 |
Pre F2F notes: Doesn't look like there's anything to discuss |
F2F: We will have the active worker internal slot in global objects and have the corresponding environment settings objects return those values. This issue depends on and will be resolved by the changes that client-creating steps will make (among HTML, SW, and Fetch): #870. |
The active service worker has settled on the newly defined environment concept finally! |
It seems the navigation behavior in HTML has changed and says now a navigation doesn't create a new environment settings object but just re-use the settings object for the browsing context: https://html.spec.whatwg.org/#navigating-across-documents:set-up-a-browsing-context-environment-settings-object.
An environment settings object is a good fit to cover both window clients and worker clients. I think service worker client's active worker should move to environment settings object. And resetting the active worker can be specified in the HTML navigation algorithm. WDYT?
/cc @annevk @domenic
The text was updated successfully, but these errors were encountered: