1.0.0 • Published 8 years ago

launch-browser v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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