I have a Safari/Firefox/Chrome browser. My browser has devtools. Is there a way to happy send/edit websocket messages for existing connection? Or by plugin?
Thank you
I have a Safari/Firefox/Chrome browser. My browser has devtools. Is there a way to happy send/edit websocket messages for existing connection? Or by plugin?
Thank you
You can grab instance of websocket
connection and can use it further to send further messages on it.
You must be aware of websocket connection establishment as below:
websocket = new WebSocket('your-ws-url-goes-here');
Now you can use instance of websocket
and can use .send()
and .close()
.
Your question states that you want to use existing connected web socket, you can look for socket connection instance in source code and can use it for sending further messages.
You can play with websocket and its instance here at http://websocket.org/echo.html
Notice here
var wsUri = "wss://echo.websocket.org/";
and function having
websocket = new WebSocket(wsUri);
You so you know websocket is connected and having instance in websocket
You can open devtool
and type websocket
to see all of the option. So in your case you need to find instance of connection so you can play with it.
I couldn't find if there is any way to edit sent messages, and i think it should not be there. You can send new message since earlier message must have been responded already.
devtools -> memory -> heap dump, search "websocket" and expand, right click some of them -> store as a global variable
. There might be several so you need the correct one, check temp1.url
to see. –
Pessary queryObjects(WebSocket)
. It should list all instances after a while.temp1.send(JSON.stringify({websocket: 'message'}))
.temp1.send('{your: "message"}')
–
Untouchable You can grab instance of websocket
connection and can use it further to send further messages on it.
You must be aware of websocket connection establishment as below:
websocket = new WebSocket('your-ws-url-goes-here');
Now you can use instance of websocket
and can use .send()
and .close()
.
Your question states that you want to use existing connected web socket, you can look for socket connection instance in source code and can use it for sending further messages.
You can play with websocket and its instance here at http://websocket.org/echo.html
Notice here
var wsUri = "wss://echo.websocket.org/";
and function having
websocket = new WebSocket(wsUri);
You so you know websocket is connected and having instance in websocket
You can open devtool
and type websocket
to see all of the option. So in your case you need to find instance of connection so you can play with it.
I couldn't find if there is any way to edit sent messages, and i think it should not be there. You can send new message since earlier message must have been responded already.
devtools -> memory -> heap dump, search "websocket" and expand, right click some of them -> store as a global variable
. There might be several so you need the correct one, check temp1.url
to see. –
Pessary © 2022 - 2024 — McMap. All rights reserved.