selenium-standalone
Advanced tools
Comparing version 2.44.0-1 to 2.44.0-3
var path = require('path'); | ||
// see http://selenium-release.storage.googleapis.com/index.html for latest | ||
var version = '2.44.0'; | ||
var version = process.env.SELENIUM_VERSION || '2.44.0'; | ||
@@ -14,3 +14,3 @@ module.exports = { | ||
// see http://chromedriver.storage.googleapis.com/index.html | ||
v: '2.12' | ||
v: process.env.CHROMEDRIVER_VERSION || '2.13' | ||
}, | ||
@@ -20,5 +20,5 @@ ieDr: { | ||
// see http://selenium-release.storage.googleapis.com/index.html | ||
v: '2.44.0', | ||
v: process.env.IEDRIVER_VERSION || '2.44.0', | ||
arch: process.env.IEDRIVER_ARCH !== undefined ? process.env.IEDRIVER_ARCH : process.arch | ||
} | ||
}; |
17
index.js
@@ -9,3 +9,5 @@ var spawn = require('child_process').spawn; | ||
var killEvents = ['exit', 'SIGTERM', 'SIGINT']; | ||
var processes = []; | ||
var registered = false; | ||
@@ -20,2 +22,7 @@ /** | ||
function standalone(spawnOptions, seleniumArgs) { | ||
if (!registered) { | ||
killEvents.forEach(listenAndKill); | ||
registered = true; | ||
} | ||
spawnOptions = spawnOptions || { stdio: 'inherit' }; | ||
@@ -48,10 +55,16 @@ seleniumArgs = seleniumArgs || []; | ||
} | ||
killEvents.forEach(unregister); | ||
} | ||
['exit', 'SIGTERM', 'SIGINT'].forEach(function listenAndKill(evName) { | ||
function listenAndKill(evName) { | ||
process.on(evName, kill); | ||
}); | ||
} | ||
function unregister(evName) { | ||
process.removeListener(evName, kill); | ||
} | ||
// backward compat with original programmatic PR | ||
// https://github.com/vvo/selenium-standalone/pull/4 | ||
standalone.start = standalone; |
@@ -127,7 +127,2 @@ var async = require('async'); | ||
if (res.statusCode === 302 && res.headers.location) { | ||
r.abort(); | ||
return getDownloadStream(res.headers.location, cb); | ||
} | ||
if (res.statusCode !== 200) { | ||
@@ -134,0 +129,0 @@ return cb(new Error('Could not download ' + downloadUrl)); |
{ | ||
"name": "selenium-standalone", | ||
"version": "2.44.0-1", | ||
"version": "2.44.0-3", | ||
"description": "installs a `start-selenium` command line to start a standalone selenium server with chrome-driver", | ||
@@ -32,4 +32,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"mocha": "^1.19.0" | ||
"mocha": "^2.0.1" | ||
} | ||
} | ||
} |
@@ -12,4 +12,2 @@ # selenium-standalone | ||
Currently installs selenium `2.44.0`, chrome driver `2.12` and internet explorer driver `2.44.0`. | ||
```shell | ||
@@ -26,2 +24,11 @@ npm install selenium-standalone@latest -g | ||
## Selenium version | ||
Currently installs selenium `2.44.0`, chrome driver `2.13` and internet explorer driver `2.44.0` by default. You can override the versions installed by defining `SELENIUM_VERSION`, `CHROMEDRIVER_VERSION` or `IEDRIVER_VERSION` env variables before `npm install`ing | ||
```shell | ||
SELENIUM_VERSION=2.42.0 npm install selenium-standalone@latest -g | ||
start-selenium | ||
``` | ||
## Running headlessly | ||
@@ -28,0 +35,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12863
12
227
95
6