Created
May 11, 2018 08:58
-
-
Save radum/1ba3c188ba795453b678020ff8f8c515 to your computer and use it in GitHub Desktop.
Devtools protocol monitor in JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ws = new WebSocket('http://localhost:9222/json'); | |
ws.on('open', () => { | |
ws.send(JSON.stringify({ | |
id: 1, | |
method: 'Runtime.evaluate', | |
params: { | |
expression: 'document.title' | |
} | |
})); | |
}).on('message', data => { | |
data = JSON.parse(data); | |
console.log(data.result.result.value); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment