lucacasonato/deno-puppeteer

Excited to try out `--headless=new` in Chrome 112+

johnspurlock opened this issue · 3 comments

Looks like there was a rather huge announcement recently:
https://developer.chrome.com/articles/new-headless/

Chrome 112 has a new headless option to share much more of the browser code with Chrome proper!

Need to pass --headless=new into Chrome 112 or above.

Any tips on how to get this working in Deno?

I think you might be able to just

puppeteer.launch({
	args: ["--headless=new"],
});

Launch options also have the headless property though, not sure if that will interfere with this.

This fork is pegged against a specific version of Chrome, so would be great to see it refreshed so that would work.

Looks like this is just a one-time proof of concept though.

You can launch a specific Chromium binary with the executablePath option in launch, though only the included version is officially supported so this might not work.

You can download a specific version like this:

const fetcher = puppeteer.createBrowserFetcher({
	product: "chrome",
});
let revisionInfo = fetcher.revisionInfo(PUPPETEER_REVISIONS.chromium);
if (!revisionInfo.local) {
	revisionInfo = await fetcher.download(PUPPETEER_REVISIONS.chromium);
}
console.log(revisionInfo.executablePath);