0

Let's say I have 2 following tabs opened in a Google Chrome browser:

  1. https://github.com
  2. https://stackoverflow.com

Now, from the Node.js, I want to get access to the entire HTML of any of the tab. Is it possible?

I think that is possible to do it using Chrome DevTools Protocol (https://chromedevtools.github.io/), but CDP requires to launch chrome from a terminal with --remote-debugging-port=9222 flag, which is not ideally what I would want.

Is it possible to somehow connect to Google Chrome that is already opened?

feerlay
  • 2,286
  • 5
  • 23
  • 47

1 Answers1

1

No, due to security issues.

Imagine that someone has the ability to spy on every page you enter (and technically, using CDP, change what you're seeing or the page's behavior). We obviously don't want that.

Kle0s
  • 113
  • 1
  • 8