Skip to content
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

postMessage() to a reserved client throws #1035

Closed
jungkees opened this issue Dec 19, 2016 · 3 comments
Closed

postMessage() to a reserved client throws #1035

jungkees opened this issue Dec 19, 2016 · 3 comments

Comments

@jungkees
Copy link
Collaborator

While discussing #1031 (comment), I noticed that client.postMessage() to a reserved client in the current spec throws as the destination (ServiceWorkerContainer) object shouldn't have been created yet. I think we may need a separate message queue to hold the messages while a client is in the reserved state, and re-queue them to the client message queue of the ServiceWorkerContainer object when it's created.

@jakearchibald
Copy link
Contributor

F2F: Update the spec to allow buffering. Including across redirects, unless the redirect is across origins.

@domenic
Copy link
Contributor

domenic commented Apr 3, 2017

Language about queues and moving queued up things between them is already present in HTML for MessagePorts. See e.g. the transferring steps at https://html.spec.whatwg.org/#create-a-new-messageport-object

You may want to copy that, or even use MessagePorts as some underlying mechanism like HTML does for workers (see https://html.spec.whatwg.org/#dom-worker-postmessage).

@jakearchibald
Copy link
Contributor

We aren't going to expose reserved clients, so this is no longer an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants