-
Notifications
You must be signed in to change notification settings - Fork 56
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
documentUrl
and documentOrigin
should be just url
and origin
in runtime.getContexts and be defined for the worker context
#695
Comments
documentUrl
and documentOrigin
should be just url
and origin
in runtime.getContextsdocumentUrl
and documentOrigin
should be just url
and origin
in runtime.getContexts and be defined for the worker context
We discussed this today at TPAC. Originally we considered the role of content scripts in the design of |
Looks like you've ignored this problem:
I guess I should open a new issue about that? |
What is the use case for that? In extensions, only one extension service worker is supported. I know that the web supports multiple service registrations via the Note: Firefox does not allow extensions to register its own service workers. The Service Worker specification specifies that the Since we're in the realm of the regular web platform, you could also compare this with dedicated workers ( |
The use case is proper support of the existing capabilities as extensions support multiple service workers in Chrome. Such a worker doesn't have access to chrome extensions API, but that doesn't mean it's not a context of this extension. |
It is intentional, rdevlin explicitly stated it several times. |
Looks like a bug in the design of the API, because these workers are also meaningful contexts of the extension. |
OTOH, my mistake is that I use a common technical definition for "context" whereas here it means an API-reachable context. |
Any context, be it a document or a worker, always has an intrinsic URL exposed in its
location
object, so adding the worddocument
is redundant, inconsequential, and wrong as we can't tell one service worker from another (in Chrome extensions can register multiple service workers for nested paths under the root).url
andorigin
should be used instead and workers should be supported as they also have a URL (location.href
) and origin (location.origin
).documentUrl
anddocumentOrigin
should be kept as a deprecated alias, its value should remain undefined in a non-document context for compatibility with the existing code.No changes for
documentId
which is a synthetic separate concept used in many places in other APIs such as tabs, webRequest, webNavigation.The text was updated successfully, but these errors were encountered: