This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Right now the websocket protocol doesn't say what event.origin should return for message events fired for incoming data, which I believe implicitly means that it should be the empty string. It seems nice if it was more consistent with EventSource which uses the origin of the server we're connected to.
Oops, wrong component.
http://www.whatwg.org/specs/web-apps/current-work/complete.html#messageevent defines the default as being the empty string, yes. What origin would you want it set to? Web Sockets by definition are same-origin with whatever script created them (they don't connect successfully otherwise). I suppose we could parse WebSocket.url and set MessageEvent.origin to the scheme, host, and port parts of that URL, but that seems a bit awkward (and wouldn't really be an origin in the technical sense).
Why wouldn't that be a origin in the technical sense?
We talked about this on IRC. I'll do what EventSource does (it also doesn't use what is technically the origin, but this is mostly a matter of how you view things and if it'll help authors, why not expose it).
Checked in as WHATWG revision r6386. Check-in comment: Make event.origin for WebSockets work like it does for EventSource, for consistency. http://html5.org/tools/web-apps-tracker?from=6385&to=6386