Is it possible to open a local HTML file with headless Chrome using Puppeteer (without a web server)? I could only get it to work against a local server.
I found
You can use file-url to prepare the URL to pass to page.goto:
file-url
page.goto
const fileUrl = require('file-url'); const puppeteer = require('puppeteer'); const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto(fileUrl('file.html')); await browser.close();