Determine ws event frame type.

To determine the websocket frame type you can use the following comparisons:

  • e.data instanceof ArrayBuffer
  • e.data instanceof Blob
  • typeof e.data === "string"

Links:

stackoverflow.com

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.