Re: [ServiceWorker] Specify serviceworker link type for link element and link header. (#828)

> @mkruisselbrink you should probably figure out what bits the algorithm needs from client and require those to be passed in, instead.

Yeah, it seems the client is used for two (well, currently three) things:

1. the origin is needed to make sure the script/scope are on the origin as the client that called register
2. the full client is used to set the client property of the fetch request that retrieves the worker script
3. Issue #829, the client is for some reason associated with the returned `ServiceWorkerRegistration`

This third one I'll ignore for now, since it's broken anyway. For the second one it is probably correct to have a null client, just like in some update checks. So that leaves the first one; either I can add the "client" origin as a separate field for a job (which would only be used by register jobs), or maybe it makes sense to move those checks to before the job is scheduled. It's not entirely clear to me why some origin checks are done before a register job is created, and some are done when the register job is executed. It seems like it should be fine to do all parameter validation before potentially scheduling a register job.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/pull/828#issuecomment-181526526

Received on Monday, 8 February 2016 20:45:01 UTC