{"_id":"browser-launcher2","_rev":"437626","name":"browser-launcher2","description":"Detect, launch and stop browser versions","dist-tags":{"latest":"0.4.6"},"maintainers":[{"name":"cksource","email":"npm@cksource.com"}],"time":{"modified":"2021-08-05T06:21:54.000Z","created":"2014-08-08T13:37:29.405Z","0.4.6":"2015-08-20T06:26:35.452Z","0.4.5":"2015-04-17T08:11:47.480Z","0.4.4":"2014-11-28T10:05:22.538Z","0.4.3":"2014-09-23T11:39:23.848Z","0.4.2":"2014-09-10T09:45:46.133Z","0.4.1":"2014-08-08T13:48:03.270Z","0.4.0":"2014-08-08T13:37:29.405Z"},"users":{},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/benderjs/browser-launcher2.git"},"versions":{"0.4.6":{"name":"browser-launcher2","version":"0.4.6","description":"Detect, launch and stop browser versions","main":"index.js","scripts":{"lint":"jscs . && jshint index.js lib/ example/"},"directories":{"example":"example","res":"res"},"dependencies":{"headless":"^0.1.7","lodash":"^2.4.1","mkdirp":"^0.5.0","osenv":"^0.1.0","plist":"^1.0.1","win-detect-browsers":"^1.0.1","uid":"0.0.2","rimraf":"~2.2.8"},"repository":{"type":"git","url":"git://github.com/benderjs/browser-launcher2.git"},"homepage":"https://github.com/benderjs/browser-launcher2","keywords":["browser","headless","phantom","chrome","firefox","chromium","safari","ie","opera","osx","windows"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"contributors":[{"name":"CKSource","url":"http://cksource.com/"}],"license":"MIT","engine":{"node":">=0.8"},"devDependencies":{"jscs":"^1.5.8","jshint":"^2.5.2"},"gitHead":"e7f7cc3fbd8dcacf4e42b2d48b238451984e9d5f","bugs":{"url":"https://github.com/benderjs/browser-launcher2/issues"},"_id":"browser-launcher2@0.4.6","_shasum":"51598408a13f4c9c5b20eba44554b2c0b0ae4074","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"cksource","email":"npm@cksource.com"},"dist":{"shasum":"51598408a13f4c9c5b20eba44554b2c0b0ae4074","size":14728,"noattachment":false,"key":"/browser-launcher2/-/browser-launcher2-0.4.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-launcher2/download/browser-launcher2-0.4.6.tgz"},"maintainers":[{"name":"cksource","email":"npm@cksource.com"}],"publish_time":1440051995452,"_cnpm_publish_time":1440051995452,"_hasShrinkwrap":false},"0.4.5":{"name":"browser-launcher2","version":"0.4.5","description":"Detect, launch and stop browser versions","main":"index.js","scripts":{"lint":"jscs . && jshint index.js lib/ example/"},"directories":{"example":"example","res":"res"},"dependencies":{"headless":"^0.1.7","lodash":"^2.4.1","mkdirp":"^0.5.0","osenv":"^0.1.0","plist":"^1.0.1","win-detect-browsers":"^1.0.1","uid":"0.0.2","rimraf":"~2.2.8"},"repository":{"type":"git","url":"git://github.com/benderjs/browser-launcher2.git"},"homepage":"https://github.com/benderjs/browser-launcher2","keywords":["browser","headless","phantom","chrome","firefox","chromium","safari","ie","opera","osx","windows"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"contributors":[{"name":"CKSource","url":"http://cksource.com/"}],"license":"MIT","engine":{"node":">=0.8"},"devDependencies":{"jscs":"^1.5.8","jshint":"^2.5.2"},"gitHead":"13924a4b50edc3038a0cccbd0a07b72733af9c01","bugs":{"url":"https://github.com/benderjs/browser-launcher2/issues"},"_id":"browser-launcher2@0.4.5","_shasum":"9b05fd5ead86a8931d20d5517e253d420882975a","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"cksource","email":"npm@cksource.com"},"maintainers":[{"name":"cksource","email":"npm@cksource.com"}],"dist":{"shasum":"9b05fd5ead86a8931d20d5517e253d420882975a","size":12262,"noattachment":false,"key":"/browser-launcher2/-/browser-launcher2-0.4.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-launcher2/download/browser-launcher2-0.4.5.tgz"},"publish_time":1429258307480,"_cnpm_publish_time":1429258307480,"_hasShrinkwrap":false},"0.4.4":{"name":"browser-launcher2","version":"0.4.4","description":"Detect, launch and stop browser versions","main":"index.js","scripts":{"lint":"jscs . && jshint index.js lib/ example/"},"directories":{"example":"example","res":"res"},"dependencies":{"headless":"^0.1.7","lodash":"^2.4.1","mkdirp":"^0.5.0","osenv":"^0.1.0","plist":"^1.0.1","win-detect-browsers":"^0.0.2","uid":"0.0.2","rimraf":"~2.2.8"},"repository":{"type":"git","url":"git://github.com/benderjs/browser-launcher2.git"},"homepage":"https://github.com/benderjs/browser-launcher2","keywords":["browser","headless","phantom","chrome","firefox","chromium","safari","ie","opera","osx","windows"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"contributors":[{"name":"CKSource","url":"http://cksource.com/"}],"license":"MIT","engine":{"node":">=0.8"},"devDependencies":{"jscs":"^1.5.8","jshint":"^2.5.2"},"gitHead":"66d3c3235eca1b708cf92f5d390e8412b1cb9040","bugs":{"url":"https://github.com/benderjs/browser-launcher2/issues"},"_id":"browser-launcher2@0.4.4","_shasum":"1e2b98ec9bc1c711084174d5b2c82598b5c0d1e4","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"cksource","email":"npm@cksource.com"},"maintainers":[{"name":"cksource","email":"npm@cksource.com"}],"dist":{"shasum":"1e2b98ec9bc1c711084174d5b2c82598b5c0d1e4","size":10745,"noattachment":false,"key":"/browser-launcher2/-/browser-launcher2-0.4.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-launcher2/download/browser-launcher2-0.4.4.tgz"},"publish_time":1417169122538,"_cnpm_publish_time":1417169122538,"_hasShrinkwrap":false},"0.4.3":{"name":"browser-launcher2","version":"0.4.3","description":"Detect, launch and stop browser versions","main":"index.js","scripts":{"lint":"jscs . && jshint index.js lib/ example/"},"directories":{"example":"example","res":"res"},"dependencies":{"headless":"^0.1.7","lodash":"^2.4.1","mkdirp":"^0.5.0","osenv":"^0.1.0","plist":"^1.0.1","win-detect-browsers":"^0.0.2"},"repository":{"type":"git","url":"git://github.com/benderjs/browser-launcher2.git"},"homepage":"https://github.com/benderjs/browser-launcher2","keywords":["browser","headless","phantom","chrome","firefox","chromium","safari","ie","opera","osx","windows"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"contributors":[{"name":"CKSource","url":"http://cksource.com/"}],"license":"MIT","engine":{"node":">=0.8"},"devDependencies":{"jscs":"^1.5.8","jshint":"^2.5.2"},"gitHead":"fd56eb1e6f065234fee8f57fedd12f04e58f308c","bugs":{"url":"https://github.com/benderjs/browser-launcher2/issues"},"_id":"browser-launcher2@0.4.3","_shasum":"4df95a3f21551be5e37260fe5f2ecb57c7b026e9","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"cksource","email":"npm@cksource.com"},"maintainers":[{"name":"cksource","email":"npm@cksource.com"}],"dist":{"shasum":"4df95a3f21551be5e37260fe5f2ecb57c7b026e9","size":10507,"noattachment":false,"key":"/browser-launcher2/-/browser-launcher2-0.4.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-launcher2/download/browser-launcher2-0.4.3.tgz"},"publish_time":1411472363848,"_cnpm_publish_time":1411472363848,"_hasShrinkwrap":false},"0.4.2":{"name":"browser-launcher2","version":"0.4.2","description":"Detect, launch and stop browser versions","main":"index.js","scripts":{"lint":"jscs . && jshint index.js lib/ example/"},"directories":{"example":"example","res":"res"},"dependencies":{"headless":"^0.1.7","lodash":"^2.4.1","mkdirp":"^0.5.0","osenv":"^0.1.0","plist":"^1.0.1","win-detect-browsers":"^0.0.2"},"repository":{"type":"git","url":"git://github.com/benderjs/browser-launcher2.git"},"homepage":"https://github.com/benderjs/browser-launcher2","keywords":["browser","headless","phantom","chrome","firefox","chromium","safari","ie","opera","osx","windows"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"contributors":[{"name":"CKSource","url":"http://cksource.com/"}],"license":"MIT","engine":{"node":">=0.8"},"devDependencies":{"jscs":"^1.5.8","jshint":"^2.5.2"},"bugs":{"url":"https://github.com/benderjs/browser-launcher2/issues"},"_id":"browser-launcher2@0.4.2","_shasum":"6cb6d4fe1a8bb52b57719a0d62fa4ba780b95393","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"cksource","email":"npm@cksource.com"},"maintainers":[{"name":"cksource","email":"npm@cksource.com"}],"dist":{"shasum":"6cb6d4fe1a8bb52b57719a0d62fa4ba780b95393","size":10483,"noattachment":false,"key":"/browser-launcher2/-/browser-launcher2-0.4.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-launcher2/download/browser-launcher2-0.4.2.tgz"},"publish_time":1410342346133,"_cnpm_publish_time":1410342346133,"_hasShrinkwrap":false},"0.4.1":{"name":"browser-launcher2","version":"0.4.1","description":"Detect, launch and stop browser versions","main":"index.js","scripts":{"lint":"jscs . && jshint index.js lib/ example/"},"directories":{"example":"example","res":"res"},"dependencies":{"headless":"^0.1.7","lodash":"^2.4.1","mkdirp":"^0.5.0","osenv":"^0.1.0","plist":"^1.0.1","win-detect-browsers":"^0.0.2"},"repository":{"type":"git","url":"git://github.com/benderjs/browser-launcher2.git"},"homepage":"https://github.com/benderjs/browser-launcher2","keywords":["browser","headless","phantom","chrome","firefox","chromium","safari","ie","opera","osx","windows"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"contributors":[{"name":"CKSource","url":"http://cksource.com/"}],"license":"MIT","engine":{"node":">=0.8"},"devDependencies":{"jscs":"^1.5.8","jshint":"^2.5.2"},"gitHead":"cda6e6461814de133ef6b955fab5e1e284928e96","bugs":{"url":"https://github.com/benderjs/browser-launcher2/issues"},"_id":"browser-launcher2@0.4.1","_shasum":"077a5a43e25b6d11be17c5d4fa31fdbfe92a1d14","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"cksource","email":"npm@cksource.com"},"maintainers":[{"name":"cksource","email":"npm@cksource.com"}],"dist":{"shasum":"077a5a43e25b6d11be17c5d4fa31fdbfe92a1d14","size":10456,"noattachment":false,"key":"/browser-launcher2/-/browser-launcher2-0.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-launcher2/download/browser-launcher2-0.4.1.tgz"},"publish_time":1407505683270,"_cnpm_publish_time":1407505683270,"_hasShrinkwrap":false},"0.4.0":{"name":"browser-launcher2","version":"0.4.0","description":"Detect, launch and stop browser versions","main":"index.js","scripts":{"lint":"jscs . && jshint index.js lib/ example/"},"directories":{"example":"example","res":"res"},"dependencies":{"headless":"^0.1.7","lodash":"^2.4.1","mkdirp":"^0.5.0","osenv":"^0.1.0","plist":"^1.0.1","win-detect-browsers":"^0.0.2"},"repository":{"type":"git","url":"git://github.com/benderjs/browser-launcher2.git"},"homepage":"https://github.com/benderjs/browser-launcher2","keywords":["browser","headless","phantom","chrome","firefox","chromium","safari","ie","opera","osx","windows"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"contributors":[{"name":"CKSource","url":"http://cksource.com/"}],"license":"MIT","engine":{"node":">=0.8"},"devDependencies":{"jscs":"^1.5.8","jshint":"^2.5.2"},"gitHead":"b251f5db535219dd4360039a4b6570176f4be83d","bugs":{"url":"https://github.com/benderjs/browser-launcher2/issues"},"_id":"browser-launcher2@0.4.0","_shasum":"ea2a66bcab26415a9f11728f66f885416092e7eb","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"cksource","email":"npm@cksource.com"},"maintainers":[{"name":"cksource","email":"npm@cksource.com"}],"dist":{"shasum":"ea2a66bcab26415a9f11728f66f885416092e7eb","size":10441,"noattachment":false,"key":"/browser-launcher2/-/browser-launcher2-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/browser-launcher2/download/browser-launcher2-0.4.0.tgz"},"publish_time":1407505049405,"_cnpm_publish_time":1407505049405,"_hasShrinkwrap":false}},"readme":"# browser-launcher2\n\n[![Get it on npm](https://nodei.co/npm/browser-launcher2.png?compact=true)](https://www.npmjs.org/package/browser-launcher2)\n\nDetect the browser versions available on your system and launch them in an\nisolated profile for automated testing purposes.\n\nYou can launch browsers headlessly (using [Xvfb](http://en.wikipedia.org/wiki/Xvfb) or with [PhantomJS](http://phantomjs.org/)) and set\nthe proxy configuration on the fly.\n\nIt's a fork of [substack/browser-launcher](https://github.com/substack/browser-launcher) repository which seems to be no longer maintained.\n\n## Differences from *browser-launcher*\n\n- contains fixes and pull requests for unresolved issues reported in original repository\n- `launcher.browsers` is an array of local browsers only, not an object as it was before\n- `launch` callback returns an `Instance` instead of a child process, see API section for more details\n- uses [win-detect-browsers](https://github.com/vweevers/win-detect-browsers) for browser detection on Windows\n- more browsers supported\n\n## Supported browsers\n\nThe goal for this module is to support all major browsers on every desktop platform.\n\nAt the moment, `browser-launcher2` supports following browsers on Windows, Unix and OS X:\n\n- Chrome\n- Chromium\n- Firefox\n- IE (Windows only)\n- Opera\n- Safari\n- PhantomJS\n\n## Install\n\n```\nnpm install browser-launcher2\n```\n\n## Example\n\n### Browser launch\n```js\nvar launcher = require( 'browser-launcher2' );\n\nlauncher( function( err, launch ) {\n\tif ( err ) {\n\t\treturn console.error( err );\n\t}\n\n\tlaunch( 'http://cksource.com/', 'chrome', function( err, instance ) {\n\t\tif ( err ) {\n\t\t\treturn console.error( err );\n\t\t}\n\n\t\tconsole.log( 'Instance started with PID:', instance.pid );\n\n\t\tinstance.on( 'stop', function( code ) {\n\t\t\tconsole.log( 'Instance stopped with exit code:', code );\n\t\t} );\n\t} );\n} );\n```\n\nOutputs:\n\n```\n$ node example/launch.js\nInstance started with PID: 12345\nInstance stopped with exit code: 0\n```\n\n### Browser detection\n```js\nvar launcher = require( '../' );\n\nlauncher.detect( function( available ) {\n\tconsole.log( 'Available browsers:' );\n\tconsole.dir( available );\n} );\n```\n\nOutputs:\n\n```bash\n$ node example/detect.js\nAvailable browsers:\n[ { name: 'chrome',\n\t\tversion: '36.0.1985.125',\n\t\ttype: 'chrome',\n\t\tcommand: 'google-chrome' },\n\t{ name: 'chromium',\n\t\tversion: '36.0.1985.125',\n\t\ttype: 'chrome',\n\t\tcommand: 'chromium-browser' },\n\t{ name: 'firefox',\n\t\tversion: '31.0',\n\t\ttype: 'firefox',\n\t\tcommand: 'firefox' },\n\t{ name: 'phantomjs',\n\t\tversion: '1.9.7',\n\t\ttype: 'phantom',\n\t\tcommand: 'phantomjs' },\n\t{ name: 'opera',\n\t\tversion: '12.16',\n\t\ttype: 'opera',\n\t\tcommand: 'opera' } ]\n```\n\n### Detaching the launched browser process from your script\n\nIf you want the opened browser to remain open after killing your script, first, you need to set `options.detached` to `true` (see the API). By default, killing your script will kill the opened browsers.\n\nThen, if you want your script to immediately return control to the shell, you may additionally call `unref` on the `instance` object in the callback:\n\n```js\nvar launcher = require('browser-launcher2');\nlauncher( function (err, launch) {\n\tlaunch( 'http://example.org/', {\n\t\tbrowser: 'chrome',\n\t\tdetached: true\n    }, function( err, instance ) {\n\t\tif ( err ) {\n\t\t\treturn console.error( err );\n\t\t}\n\n\t\tinstance.process.unref();\n\t\tinstance.process.stdin.unref();\n\t\tinstance.process.stdout.unref();\n\t\tinstance.process.stderr.unref();\n\t} );\n});\n```\n\n## API\n\n``` js\nvar launcher = require('browser-launcher2');\n```\n\n### `launcher([configPath], callback)`\n\nDetect available browsers and pass `launch` function to the callback.\n\n**Parameters:**\n- *String* `configPath` - path to a browser configuration file *(Optional)*\n- *Function* `callback(err, launch)` - function called with `launch` function and errors (if any)\n\n### `launch(uri, options, callback)`\n\nOpen given URI in a browser and return an instance of it.\n\n**Parameters:**\n- *String* `uri` - URI to open in a newly started browser\n- *Object|String* `options` - configuration options or name of a browser to launch\n- *String* `options.browser` - name of a browser to launch\n- *String* `options.version` - version of a browser to launch, if none was given, the highest available version will be launched\n- *Array* `options.options` - additional command line options\n- *String* `options.proxy` - URI of the proxy server\n- *Boolean* `options.detached` - if true, then killing your script will not kill the opened browser\n- *Boolean* `options.noProxy` - set proxy routes to skip over\n- *Boolean* `options.headless` - run a browser in a headless mode (only if **Xvfb** available)\n- *Function* `callback(err, instance)` - function fired when started a browser `instance` or an error occurred\n\n### `launch.browsers`\n\nThis property contains an array of all known and available browsers.\n\n### `instance`\n\nBrowser instance object.\n\n**Properties:**\n- *String* `command` - command used to start the instance\n- *Array* `args` - array of command line arguments used while starting the instance\n- *String* `image` - instance's image name\n- *String* `processName` - instance's process name\n- *Object* `process` - reference to instance's process started with Node's `child_process.spawn` API\n- *Number* `pid` - instance's process PID\n- *Stream* `stdout` - instance's process STDOUT stream\n- *Stream* `stderr` - instance's process STDERR stream\n\n**Events:**\n- `stop` - fired when instance stops\n\n**Methods:**\n- `stop(callback)` - stop the instance and fire the callback once stopped\n\n### `launcher.detect(callback)`\n\nDetects all browsers available.\n\n**Parameters:**\n- *Function* `callback(available)` - function called with array of all recognized browsers\n\nEach browser contains following properties:\n- `name` - name of a browser\n- `version` - browser's version\n- `type` - type of a browser i.e. browser's family\n- `command` - command used to launch a browser\n\n### `launcher.update([configFile], callback)`\n\nUpdates the browsers cache file (`~/.config/browser-launcher/config.json` is no `configFile` was given) and creates new profiles for found browsers.\n\n**Parameters:**\n- *String* `configFile` - path to the configuration file *Optional*\n- *Function* `callback(err, browsers)` - function called with found browsers and errors (if any)\n\n## Known Issues\n\n- IE8: after several starts and stops, if you manually open IE it will come up with a pop-up asking if we want to restore tabs (#21)\n- Chrome @ OSX: it's not possible to launch multiple instances of Chrome at once\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/benderjs/browser-launcher2","bugs":{"url":"https://github.com/benderjs/browser-launcher2/issues"},"license":"MIT"}