Closed Bug 982787 Opened 10 years ago Closed 9 years ago

Allow passing existing ServiceWorker to InstallEvent inside ServiceWorkerGlobalScope

Categories

(Core :: DOM: Workers, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: nsm, Unassigned)

References

(Depends on 1 open bug)

Details

This allows the new worker to inspect/communicate with the old worker when installing. But this has some tricky semantics, and might be substantial work since we don't allow nested SharedWorkers.

Ben, any thoughts about if this is possible right now or if it will need significant work?

This requires creating a ServiceWorker object in the context of a ServiceWorkerGlobalScope and allows complete API access, including postMessage().

See https://github.com/slightlyoff/ServiceWorker/blob/master/spec/service_worker/index.html#L600
Flags: needinfo?(bent.mozilla)
Nested SharedWorker is not going to happen any time soon (or ever if I have my way ;)). If that's what's needed then we need to sit down and discuss with some kind of stiff drink.
Flags: needinfo?(bent.mozilla)
Talked to Ben on Wednesday about this. He said, since ServiceWorkers always run as top-level workers, it will be easier than nesting SharedWorkers.
Since ServiceWorkerRegistration is available in the ServiceWorkerGlobalScope, the older 'event.activeWorker' can now be obtained by 'self.registration.active'. That will be dealt with in bug 1131327
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.