Bernie
Bernie

Reputation: 5055

How to "hook in" puppeteer into a running Chrome instance/tab

Is it somehow possible to attach puppeteer to a running Chrome instance (manually started browser) and then takeover control within a tab? I'm assuming that it's eventually related to start the Chrome browser using the --no-sandbox flag but don't know how to continue from there.

Thanks for any help

Upvotes: 5

Views: 4505

Answers (1)

Yaniv Efraim
Yaniv Efraim

Reputation: 6711

You can use puppeteer.connect(options) (see here):

const puppeteer = require('puppeteer');

const browserWSEndpoint = 'a browser websocket endpoint to connect to';
const browser = await puppeteer.connect({browserWSEndpoint});
//continue from here

Upvotes: 6

Related Questions