Skip to content

Instantly share code, notes, and snippets.

@umaar
Created September 14, 2017 15:47
Show Gist options
  • Select an option

  • Save umaar/ebc170660f15aa894fa4880f4b76e77d to your computer and use it in GitHub Desktop.

Select an option

Save umaar/ebc170660f15aa894fa4880f4b76e77d to your computer and use it in GitHub Desktop.
const devtools = new WebSocket('ws://localhost:9222/devtools/page/69990451-aaab-4ef8-87b1-ea77b8101b2a');
devtools.onmessage = ({data}) => {
const {result: {result: {value}}} = JSON.parse(data);
console.log('WebSocket Message Received: ', value)
};
devtools.send(JSON.stringify({
id: 1,
method: 'Runtime.evaluate',
params: {
expression: `'The current URL is: ' + location.href`
}
}));
@lls2wow

lls2wow commented May 22, 2018

Copy link
Copy Markdown

Hi , Could you help me how to change the iframe using the websocket remote debug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment