launch-browser

1.0.0 • Public • Published

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

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i launch-browser

    Weekly Downloads

    27

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • miskun