[chronik-client] Support ping / pong in browser environment
Summary:
ws.ping() is not available in the browser WebSocket object. However, ws.send is.
Implement a browser ping by subscribing to the first existing subscription if the ws.ping() method is unavailable.
Test Plan:
In nodejs, install this version of chronik-client and connect to a websocket. Subscribe. Add console.log statements to confirm ws.ping() is being used.
Implement this version of chronik-client in cashtab and npm start. Ref D15050. Confirm the browser ping is working.
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien, tobias_ruck
Differential Revision: https://reviews.bitcoinabc.org/D15052