问题
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
回答1:
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
来源:https://stackoverflow.com/questions/54922410/how-to-hook-in-puppeteer-into-a-running-chrome-instance-tab