Open prRZ5F4LXZ opened 3 years ago
Maybe Chromium stopped accepting jsonrpc
keys in input messages?
--jsonrpc
switch converts Page.navigate {"url":"https://example.com"}
to {"jsonrpc":"2.0","id":1, "method":"Page.navigate", "params":{"url":"https://example.com"}}
.
Error message suggests that it does not like jsonrpc
field.
Try to supply direct json input without the help of --jsonrpc
option. It may need readjustment.
This works for me:
url=$(curl -sg http://127.0.0.1:9222/json/new | grep webSocketDebuggerUrl | cut -d'"' -f4 | head -1)
echo '{ "id":2, "method":"Page.navigate", "params":{"url": "https://example.com"} }' | websocat -t - $url
url=$(curl -sg http://127.0.0.1:9222/json/new | grep webSocketDebuggerUrl | cut -d'"' -f4 | head -1) echo '{ "id":2, "method":"Page.navigate", "params":{"url": "https://example.com"} }' | websocat -t - $url
Tried these two commands myself on "Chromium 103.0.5060.53 (Official Build) built on Debian 11.3" - first line opened a new tab in the Chromium and second line navigated it to example.com
.
What does fail for you? Creating tab or navigating it?
url=$(curl -sg http://127.0.0.1:9222/json/new | grep webSocketDebuggerUrl | cut -d'"' -f4 | head -1) echo '{ "id":2, "method":"Page.navigate", "params":{"url": "https://example.com"} }' | websocat -t - $url
Tried these two commands myself on "Chromium 103.0.5060.53 (Official Build) built on Debian 11.3" - first line opened a new tab in the Chromium and second line navigated it to
example.com
.What does fail for you? Creating tab or navigating it?
Works for me as well.
I am trying to follow the example under "Open a tab in Chromium using remote debugging" on https://github.com/vi/websocat
But it does not work.
Does anybody know what is wrong?