This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I fully expected to see an interface ConnectEvent used to describe that APIs are available to a Shared Worker on the onconnect event handler. As this is implemented in Opera and Chrome and Safari today, I checked and there seems to be some disagreement in the implementations... Both report the event name to be MessageEvent, but WebKit doesn't have a "data" property as expected (undefined) and Opera populates a "data" property with value "connect". This delta is obviously due to an under-specification of the "connect" event type that should be fired in this case. Can this clarification please be added?
As far as I can tell the spec is unambiguous about this. The event is called 'connect', it's of type "MessageEvent", does not bubble, is not cancelable, has no default action, has a data attribute whose value is the empty string and has a ports attribute whose value is an array containing only the newly created port, and is fired asynchronously: http://www.whatwg.org/specs/web-apps/current-work/complete/workers.html#shared-workers-and-the-sharedworker-interface The MessageEvent interface additionally says that "Except where otherwise specified, when the user agent creates and dispatches a message event in the algorithms described in the following sections, the lastEventId attribute must be the empty string, the origin attribute must be the empty string, the source attribute must be null, and the ports attribute must be null": http://www.whatwg.org/specs/web-apps/current-work/complete/comms.html#messageevent It looks like WebKit and Opera both have bugs; they should set 'data' to the empty string. Please reopen this bug if I'm wrong. Thanks!
yes, it looks like I just missed the portion of the spec describing the connect event's type and related info.