chromedriver
Advanced tools
Comparing version 2.27.0 to 2.27.1
@@ -9,3 +9,2 @@ 'use strict'; | ||
var kew = require('kew'); | ||
var npmconf = require('npmconf'); | ||
var mkdirp = require('mkdirp'); | ||
@@ -49,52 +48,43 @@ var path = require('path'); | ||
npmconf.load(function (err, conf) { | ||
if (err) { | ||
console.log('Error loading npm config'); | ||
console.error(err); | ||
process.exit(1); | ||
return; | ||
} | ||
var tmpPath = findSuitableTempDirectory(); | ||
var downloadedFile = ''; | ||
var promise = kew.resolve(true); | ||
var tmpPath = findSuitableTempDirectory(conf); | ||
var downloadedFile = ''; | ||
var promise = kew.resolve(true); | ||
promise = promise.then(function () { | ||
if (chromedriver_version === 'LATEST') | ||
return getLatestVersion(getRequestOptions(cdnUrl + '/LATEST_RELEASE')); | ||
}); | ||
promise = promise.then(function () { | ||
if (chromedriver_version === 'LATEST') | ||
return getLatestVersion(getRequestOptions(conf, cdnUrl + '/LATEST_RELEASE')); | ||
}); | ||
// Start the install. | ||
promise = promise.then(function () { | ||
downloadUrl = util.format(downloadUrl, chromedriver_version, platform); | ||
var fileName = downloadUrl.split('/').pop(); | ||
downloadedFile = path.join(tmpPath, fileName); | ||
console.log('Downloading', downloadUrl); | ||
console.log('Saving to', downloadedFile); | ||
return requestBinary(getRequestOptions(downloadUrl), downloadedFile); | ||
}); | ||
// Start the install. | ||
promise = promise.then(function () { | ||
downloadUrl = util.format(downloadUrl, chromedriver_version, platform); | ||
var fileName = downloadUrl.split('/').pop(); | ||
downloadedFile = path.join(tmpPath, fileName); | ||
console.log('Downloading', downloadUrl); | ||
console.log('Saving to', downloadedFile); | ||
return requestBinary(getRequestOptions(conf, downloadUrl), downloadedFile); | ||
promise.then(function () { | ||
return extractDownload(downloadedFile, tmpPath); | ||
}) | ||
.then(function () { | ||
return copyIntoPlace(tmpPath, libPath); | ||
}) | ||
.then(function () { | ||
return fixFilePermissions(); | ||
}) | ||
.then(function () { | ||
console.log('Done. ChromeDriver binary available at', helper.path); | ||
}) | ||
.fail(function (err) { | ||
console.error('ChromeDriver installation failed', err); | ||
process.exit(1); | ||
}); | ||
promise.then(function () { | ||
return extractDownload(downloadedFile, tmpPath); | ||
}) | ||
.then(function () { | ||
return copyIntoPlace(tmpPath, libPath); | ||
}) | ||
.then(function () { | ||
return fixFilePermissions(); | ||
}) | ||
.then(function () { | ||
console.log('Done. ChromeDriver binary available at', helper.path); | ||
}) | ||
.fail(function (err) { | ||
console.error('ChromeDriver installation failed', err); | ||
process.exit(1); | ||
}); | ||
}); | ||
function findSuitableTempDirectory(npmConf) { | ||
function findSuitableTempDirectory() { | ||
var now = Date.now(); | ||
var candidateTmpDirs = [ | ||
process.env.TMPDIR || npmConf.get('tmp'), | ||
process.env.TMPDIR || process.env.npm_config_tmp, | ||
'/tmp', | ||
@@ -123,5 +113,7 @@ path.join(process.cwd(), 'tmp') | ||
function getRequestOptions(conf, downloadPath) { | ||
function getRequestOptions(downloadPath) { | ||
var options = url.parse(downloadUrl); | ||
var proxyUrl = options.protocol === 'https:' ? conf.get('https-proxy') : conf.get('proxy'); | ||
var proxyUrl = options.protocol === 'https:' | ||
? process.env.npm_config_https_proxy | ||
: (process.env.npm_config_proxy || process.env.npm_config_http_proxy); | ||
if (proxyUrl) { | ||
@@ -288,2 +280,2 @@ options = url.parse(proxyUrl); | ||
} | ||
} | ||
} |
{ | ||
"name": "chromedriver", | ||
"version": "2.27.0", | ||
"version": "2.27.1", | ||
"keywords": [ | ||
@@ -36,5 +36,4 @@ "chromedriver", | ||
"mkdirp": "^0.5.0", | ||
"npmconf": "^2.1.1", | ||
"rimraf": "^2.0.3" | ||
} | ||
} |
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 4 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
4
21949
425
17
+ Addedonce@1.4.0(transitive)
- Removednpmconf@^2.1.1
- Removedabbrev@1.1.1(transitive)
- Removedconfig-chain@1.1.13(transitive)
- Removedini@1.3.8(transitive)
- Removednopt@3.0.6(transitive)
- Removednpmconf@2.1.3(transitive)
- Removedonce@1.3.3(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedosenv@0.1.5(transitive)
- Removedproto-list@1.2.4(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@4.3.6(transitive)
- Removeduid-number@0.0.5(transitive)