can i decode websocket message in developer tools with vanilla js??
this is the code for example :
(function(send) {
WebSocket.prototype.send = function(data) {
if (data instanceof Uint8Array) {
console.log("WebSocket sent Uint8Array:", data);
}
return send.apply(this, arguments);
};
})(WebSocket.prototype.send);
this is the console log :
WebSocket sent Uint8Array:
Uint8Array(18) [0, 65, 105, 0, 0, 0, 26, 1, 0, 0, 24, 1, 52, 1, 93, 165, 121, 62, buffer: ArrayBuffer(32), byteLength: 18, byteOffset: 0, length: 18, Symbol(Symbol.toStringTag): 'Uint8Array']
bootstrap-c245bc32c3.js:1
WebSocket sent Uint8Array:
Uint8Array(7) [0, 70, 58, 26, 0, 1, 0, buffer: ArrayBuffer(32), byteLength: 7, byteOffset: 0, length: 7, Symbol(Symbol.toStringTag): 'Uint8Array']
is it possible to decode the message websocket with vanilla javascript?