launch-browser
v1.0.0
Published
Detect, launch and stop web browser from NodeJS
Downloads
513
Readme
launch-browser
Detect the browser versions available on your system and launch them in an isolated profile for automated testing purposes. Support launching browsers headlessly (using Xvfb or with PhantomJS) and set the proxy configuration on the fly.
Based on browser-launcher3 but added sugar to automate browser detection, preferred browser selection and fallback to any supported browser.
Installation
npm install launch-browser
Simple Usage
var launcher = require( 'launch-browser' );
// open browser at www.google.com
// use preferred browsers (in priority order): chrome, firefox, safari
// if no proferred browsers found, open any available browser
launcher('http://www.google.com', { browser: ['chrome', 'firefox', 'safari'] }, function(e, browser){
if(e) return console.log(e);
browser.on('stop', function(code){
console.log( 'Browser closed with exit code:', code );
});
})
Advanced Usage
See browser-launcher3 docs.
License
MIT