You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there is an illegal formatting of data through jsonrpc:
(the test is made through output of debug of chrome browser via websocket as in the doc example)
launch chrome in debug (google-chrome-stable --remote-debugging-port=9222)
get browser version parsed via jsonrpc echo '{"method":"Browser.getVersion","params":{}, "id":1}' | websocat -n1 --text - jsonrpc:ws://127.0.0.1:9222/devtools/page/<youridofwebsocket> and you will get {"jsonrpc":"2.0","id":1, "method":"{"id":1,"result":...
!! on value of method you have "{"id"... which seems illegal json, you must have "method":{"id"... without double quote before {
(if you parse data through "jq" command (...| jq '.'), it gets errors
another problem, UserAgent value is split after Mozilla value, the rest is in the "params".
other problem, on the params there is an Array with no open double quote, but ending double quote.
On the end there is too inverted "]" and "}"
see complete line : {"jsonrpc":"2.0","id":1, "method":"{"id":1,"result":{"protocolVersion":"1.3","product":"Chrome/92.0.4515.159","revision":"@0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52","userAgent":"Mozilla/5.0", "params":[(X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","jsVersion":"9.2.230.29"}}]}
if you get data without jsonrpc:, so via echo '{"method":"Browser.getVersion","params":{}, "id":1}' | websocat -n1 --text - ws://127.0.0.1:9222/devtools/page/<youridofwebsocket>
the data is correctly formatted as {"id":1,"result":{"protocolVersion":"1.3","product":"Chrome/92.0.4515.159","revision":"@0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","jsVersion":"9.2.230.29"}}
and parsing it through ...| jq '.' is correct.
If you get other chrome debug command, you get same errors of formatting via jsonrpc: (added double quote, wrong of array ending/beggin ...)
The text was updated successfully, but these errors were encountered:
It would convert Browser.getVersion {} into {"jsonrpc":"2.0","id":1, "method":"Browser.getVersion", "params":{}}
jsonrpc: overlay (or --jsonrpc option) is not required for doing JSON RPC over Websocat, it's just a helper to type JSON RPC requests interactively. The overlay is rather simplistic and does not use any actual JSON library. Recommended command line for this is:
It seems there is an illegal formatting of data through
jsonrpc:
(the test is made through output of debug of chrome browser via websocket as in the doc example)
google-chrome-stable --remote-debugging-port=9222
)echo '{"method":"Browser.getVersion","params":{}, "id":1}' | websocat -n1 --text - jsonrpc:ws://127.0.0.1:9222/devtools/page/<youridofwebsocket>
and you will get{"jsonrpc":"2.0","id":1, "method":"{"id":1,"result":...
!! on value of method you have
"{"id"..
. which seems illegal json, you must have"method":{"id"...
without double quote before{
(if you parse data through "jq" command (
...| jq '.'
), it gets errorsanother problem, UserAgent value is split after Mozilla value, the rest is in the "params".
other problem, on the params there is an Array with no open double quote, but ending double quote.
On the end there is too inverted "]" and "}"
see complete line :
{"jsonrpc":"2.0","id":1, "method":"{"id":1,"result":{"protocolVersion":"1.3","product":"Chrome/92.0.4515.159","revision":"@0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52","userAgent":"Mozilla/5.0", "params":[(X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","jsVersion":"9.2.230.29"}}]}
if you get data without
jsonrpc:
, so viaecho '{"method":"Browser.getVersion","params":{}, "id":1}' | websocat -n1 --text - ws://127.0.0.1:9222/devtools/page/<youridofwebsocket>
the data is correctly formatted as
{"id":1,"result":{"protocolVersion":"1.3","product":"Chrome/92.0.4515.159","revision":"@0185b8a19c88c5dfd3e6c0da6686d799e9bc3b52","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","jsVersion":"9.2.230.29"}}
and parsing it through
...| jq '.'
is correct.If you get other chrome debug command, you get same errors of formatting via
jsonrpc:
(added double quote, wrong of array ending/beggin ...)The text was updated successfully, but these errors were encountered: