Support multiple scopes in service workers

RESOLVED WONTFIX

Status

()

Core
DOM
RESOLVED WONTFIX
4 years ago
2 years ago

People

(Reporter: annevk, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
Google is still pushing back against multiple scopes. Let's experiment with supporting it for a year or so to see if it gains any traction:

  https://github.com/slightlyoff/ServiceWorker/issues/566 (proposal 3, see meeting summary)

Per Ehsan we should implement this before enabling.
Yeah, I think we should just do this.

The best proposal that we ended up with, and which also is completely backwards compatible, is to:

* Allow the scope parameter to be an array or a string of arrays.
* Keep the .scope property on the registration object, but make it be of type string or array of strings.
* Add a function on the activate event which allows setting the scope.

I'm unsure about how to handle "scopeless" SWs. I think they are still quite important, but the solution of simply setting the scope to null isn't particularly great. It both means that you can only have one scopeless SW (as the scope is the identifier), and there'd be no way to actually get at the registration object since getRegistration(url) would never match a scopeless worker.

Instead we might need to introduce named, scopeless, SWs. I.e. that use a name as identifier rather than a scope. But that's pretty messy so I don't love that solution.
Doesn't seem like we are doing this anymore.
Assignee: nsm.nikhil → nobody
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WONTFIX
I think we should!
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
I think the ship has sailed on this spec-wise.
Status: REOPENED → RESOLVED
Last Resolved: 3 years ago2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.