chromedriver
Advanced tools
Comparing version 2.27.2 to 2.27.3
@@ -170,4 +170,3 @@ 'use strict'; | ||
var deferred = kew.defer(); | ||
var protocol = requestOptions.protocol === 'https:' ? https : http; | ||
var client = protocol.get(requestOptions, function (response) { | ||
var client = get(requestOptions, function (response) { | ||
var body = ''; | ||
@@ -201,4 +200,3 @@ if (response.statusCode === 200) { | ||
var protocol = requestOptions.protocol === 'https:' ? https : http; | ||
var client = protocol.get(requestOptions, function (response) { | ||
var client = get(requestOptions, function (response) { | ||
var status = response.statusCode; | ||
@@ -233,2 +231,18 @@ console.log('Receiving...'); | ||
function get(requestOptions, callback, redirects) { | ||
redirects = redirects || 0; | ||
var protocol = requestOptions.protocol === 'https:' ? https : http; | ||
var client = protocol.get(requestOptions, function (response) { | ||
var status = response.statusCode; | ||
if ((status === 302 || status === 301 || status === 307) && redirects < 5) { | ||
console.log('Redirect to %s', response.headers.location); | ||
redirects++; | ||
return get(getRequestOptions(response.headers.location), callback, redirects); | ||
} | ||
callback(response); | ||
}); | ||
return client; | ||
} | ||
function extractDownload(filePath, tmpPath) { | ||
@@ -235,0 +249,0 @@ var deferred = kew.defer(); |
{ | ||
"name": "chromedriver", | ||
"version": "2.27.2", | ||
"version": "2.27.3", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "chromedriver", |
@@ -35,3 +35,3 @@ ChromeDriver | ||
```shell | ||
npm install chromedriver --chromedriver_cdnurl=http://npm.taobao.org/mirrors/chromedriver | ||
npm install chromedriver --chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver | ||
``` | ||
@@ -42,3 +42,3 @@ | ||
``` | ||
chromedriver_cdnurl=http://npm.taobao.org/mirrors/chromedriver | ||
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver | ||
``` | ||
@@ -49,3 +49,3 @@ | ||
```shell | ||
CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver npm install chromedriver | ||
CHROMEDRIVER_CDNURL=https://npm.taobao.org/mirrors/chromedriver npm install chromedriver | ||
``` | ||
@@ -52,0 +52,0 @@ |
Sorry, the diff of this file is not supported yet
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
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
23180
14
447