Checkout https://www.npmjs.com/package/chrome-launcher :
Run chrome:
const chromeLauncher = require('chrome-launcher'); chromeLauncher.launch({ startingUrl: 'https://google.com' }).then(chrome => { console.log(`Chrome debugging port running on ${chrome.port}`); });
Headless Chrome Launch:
const chromeLauncher = require('chrome-launcher'); chromeLauncher.launch({ startingUrl: 'https://google.com', chromeFlags: ['--headless', '--disable-gpu'] }).then(chrome => { console.log(`Chrome debugging port running on ${chrome.port}`); });
chrome-launcher opens the remote port for debugging, so you can also control the browser instance using DevTools .
Puppeteer is another way to launch Chrome and interact with it using a high-level API.
ebidel
source share