content icon indicating copy to clipboard operation
content copied to clipboard

WebSocket: message event properties need more explanation

Open qiulang opened this issue 1 year ago • 1 comments

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/message_event

What specific section or headline is this issue about?

message event properties

What information was incorrect, unhelpful, or incomplete?

Except for event.data & event.origin, which are obvious, all the other properties need more explanation.

lastEventId is alway an empty string '', why ?

I also see property isTrusted which was not mentioned in the link

[Log] MessageEvent {isTrusted: true, origin: "ws://localhost:3000", lastEventId: "", source: null, data: "xxx", …}

Another question who sets these properties ? Because the only possible place WebSocket.send can't set them. And I can't find a place in WebSocket API to set these properties

What did you expect to see?

A clear explanation who these properties are set.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
  • Folder: en-us/web/api/websocket/message_event
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/message_event
  • GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/websocket/message_event/index.md
  • Last commit: https://github.com/mdn/content/commit/41fe03908c341ab928c4a8d5ee48e03e28e2dd6c
  • Document last modified: 2022-06-03T04:21:39.000Z

qiulang avatar Jul 06 '22 06:07 qiulang

Regarding the isTrusted property, I believe it's from the Event interface and it did mention on the page that In addition to the properties listed below, properties from the parent interface, [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event), are available.

jamesaucode avatar Aug 05 '22 21:08 jamesaucode