Created
October 3, 2017 03:43
-
-
Save sgentle/0679ff0fc67c3ba77bc238fb166b0f30 to your computer and use it in GitHub Desktop.
This file contains 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
<script> | |
const url = 'chrome-devtools://devtools/bundled/inspector.html?nodeFrontend=true' | |
fetch(`http://localhost:${location.search.slice(1)}/json`) | |
.then(res => res.json()) | |
.then(results => results.find(x => x.url == location).webSocketDebuggerUrl) | |
.then(wsurl => ({then: addEventListener.bind(new WebSocket(wsurl), 'open')})) | |
.then(ev => ev.target.send(JSON.stringify({ | |
method: 'Page.navigate', | |
id: 0, | |
params: {url} | |
}))) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment