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
consider exposing a type attribute on Client #1005
Comments
Why? Constructors are Worker and SharedWorker. |
I guess I was thinking of how [Exposed] works in webidl. Anyway, the naming of the type is a side issue to the main idea here. |
I think it's a good idea to expose
For naming, I give my five cents to keeping consistency to the existing names. |
Works for me. I'd like to hear from someone at google if they think its something they would implement, though. |
Not sure if I speak for Google, but it does sound like a sensible addition. |
I labeled it V1 as it'd be a simple addition that won't break the time line itself. But if anyone would argue we should add it only to the Nightly, I'd be fine with that. |
This adds a type attribute to Client interface. Before this, we could only differentiate the WindowClient objects from Client objects. With the type attribute, a client can be identified as one of window, dedicated worker, and shared worker. Fixes #1005.
FYI: Chromium has started to implement this at https://crrev.com/2845963002 . |
Currently
Clients.matchAll()
considers three different types of Client objects:Currently its only possible to differentiate the Window client using
instanceof WindowClient
. Since the algorithm operates on the type, though, it would be nice to expose it for dedicated and shared workers as well.So, something like:
The value would match those used in
Clients.matchAll()
.As a side note, I find it annoying that "worker" is mapped to DedicatedWorker. I think it would have been nicer to use "dedicatedworker" and make "worker" map to all Worker types.
The text was updated successfully, but these errors were encountered: