Chrome远程调试之WebSocket


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

 

posted @ 2019-12-08 10:58  那些年的代码  阅读(3190)  评论(0编辑  收藏  举报