Socket
Socket
Sign inDemoInstall

chromedriver

Package Overview
Dependencies
Maintainers
1
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chromedriver - npm Package Compare versions

Comparing version 2.27.0 to 2.27.1

84

install.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc