var ws = new WebSocket('ws://localhost:9222/devtools/page/3c5c05fa-80b7-4cfe-8d1d-ebe79a7a5730');
ws.onopen= function() {
ws.send('{"id": 1, "method": "Page.navigate", "params": {"url": "https://www.fangdushi.com"}}')
};
ws.onmessage= function(evt) {
console.log('Received a message from the server!'+evt.data);
};
api文档地址https://chromedevtools.github.io/devtools-protocol/1-2
相关博文
Chrome调试WebSocket