Reputation: 7943
I'm using Puppeteer to show a Chromium window. However, I would like to hide the address bar (i.e.: where you can input the URL) so that the user cannot navigate away from the page I've set.
Is this possible? I've tried passing the --kiosk
command line argument, but this forces the browser to go fullscreen, which I don't want, I still want it to be in a window. Is there any way to do it?
Upvotes: 0
Views: 2289
Reputation: 18836
You can do the following as long as chromium supports Apps,
(async () => {
const browser = await puppeteer.launch({ headless: false, args: ['--app=http://example.com'] });
const [page] = await browser.pages();
await page.screenshot({path: 'example.png'});
await browser.close();
})();
What's happening:
--app=
argument will make it open in app mode (not fullscreen, no url bar, it's a window etc.).browser.pages()
will return the current open pages in an array.Upvotes: 3