I am able to connect to Chrome running on port 3000 on Docker with Puppeteer, but even though I use the {headless: true} parameter, I cannot see the browser. This parameter works for the launch function but I cannot connect to the Docker Chrome with the launch function, and I am not sure if it actually works for the connect function, so how can i see the Chrome running on Docker with Puppeteer.
Docker code: run -d -p 3000:3000 --name browserless --shm-size 2gb -e "MAX_CONCURRENT_SESSIONS=10" -e DISPLAY=:99 --restart always browserless/chrome
Node.js
const puppeteer = require('puppeteer');
(async () => {
try {
browser = await puppeteer.connect({
headless: false,
browserWSEndpoint: 'ws://localhost:3000',
});
const page = await browser.newPage();
await page.goto('https://www.google.com/');
await page.evaluate(() => {
});
} catch (err) {
console.error(err);
}
})();