This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28199 - Allow source of MessageEvent to be ServiceWorker object / Client object for messaging in Service Worker
Summary: Allow source of MessageEvent to be ServiceWorker object / Client object for m...
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-12 05:35 UTC by Jungkee Song
Modified: 2015-05-06 13:33 UTC (History)
6 users (show)

See Also:


Attachments

Description Jungkee Song 2015-03-12 05:35:00 UTC
The service worker messaging behavior (between a service worker and its client) has been sorted out (https://github.com/slightlyoff/ServiceWorker/issues/609#issuecomment-75739069) and spec'ed (6dfce0aacceeef41c813c4680c7f67b96f80c4b6).

- ServiceWorker.postMessage: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-postmessage
- Client.postMessage: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#client-postmessage

For this, we'd like HTML extend the event attribute of MessageEvent to be able to include ServiceWorker object and Client object.

Could you address this in the IDL definition and the source attribute definition of MessageEvent?
Comment 1 Ian 'Hixie' Hickson 2015-03-30 22:58:54 UTC
Why do you want to use MessageEvent specifically rather than a new Event class?
Comment 2 Jungkee Song 2015-03-31 02:19:39 UTC
The reason is consistency to the existing web messaging APIs. Authors would expect that they're to use the same API. Indeed, the _source_ attribute is the only property that SW wants to extend.
Comment 3 Jungkee Song 2015-04-02 10:17:57 UTC
Hixie, FYI, we started a discussion about some more extension point: https://github.com/slightlyoff/ServiceWorker/issues/669.

So, maybe we'll need a subclass. But I'm not sure what a good direction is as of now. I'll update if we make progress on that.
Comment 4 Ian 'Hixie' Hickson 2015-04-07 22:38:42 UTC
It's not the same API if you're using a different set of attributes...