chromedriver 2.43.4 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/install.js +11 -4
- package/lib/chromedriver.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ChromeDriver
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/giggio/node-chromedriver/) [](https://ci.appveyor.com/project/giggio/node-chromedriver)
|
|
3
|
+
[](https://travis-ci.org/giggio/node-chromedriver/) [](https://ci.appveyor.com/project/giggio/node-chromedriver) [](https://app.shippable.com/github/giggio/node-chromedriver/runs?branchName=master)
|
|
4
4
|
[](https://www.npmjs.com/package/chromedriver)
|
|
5
5
|
|
|
6
6
|
An NPM wrapper for Selenium [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/).
|
package/install.js
CHANGED
|
@@ -44,15 +44,19 @@ if (platform === 'linux') {
|
|
|
44
44
|
console.log('Unexpected platform or architecture:', process.platform, process.arch);
|
|
45
45
|
process.exit(1);
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
let tmpPath;
|
|
48
48
|
const chromedriverBinaryFileName = process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver';
|
|
49
|
-
|
|
49
|
+
let chromedriverBinaryFilePath;
|
|
50
50
|
let downloadedFile = '';
|
|
51
51
|
|
|
52
52
|
Promise.resolve().then(function () {
|
|
53
53
|
if (chromedriver_version === 'LATEST')
|
|
54
54
|
return getLatestVersion(getRequestOptions(cdnUrl + '/LATEST_RELEASE'));
|
|
55
55
|
})
|
|
56
|
+
.then(() => {
|
|
57
|
+
tmpPath = findSuitableTempDirectory();
|
|
58
|
+
chromedriverBinaryFilePath = path.resolve(tmpPath, chromedriverBinaryFileName );
|
|
59
|
+
})
|
|
56
60
|
.then(verifyIfChromedriverIsAvailableAndHasCorrectVersion)
|
|
57
61
|
.then(chromedriverIsAvailable => {
|
|
58
62
|
if (chromedriverIsAvailable) return;
|
|
@@ -71,6 +75,7 @@ function downloadFile() {
|
|
|
71
75
|
if (configuredfilePath) {
|
|
72
76
|
downloadedFile = configuredfilePath;
|
|
73
77
|
console.log('Using file: ', downloadedFile);
|
|
78
|
+
return Promise.resolve();
|
|
74
79
|
} else {
|
|
75
80
|
const fileName = `chromedriver_${platform}.zip`;
|
|
76
81
|
const tempDownloadedFile = path.resolve(tmpPath, fileName);
|
|
@@ -108,7 +113,7 @@ function verifyIfChromedriverIsAvailableAndHasCorrectVersion() {
|
|
|
108
113
|
return deferred.resolve(false);
|
|
109
114
|
if (parts[1].startsWith(chromedriver_version)) {
|
|
110
115
|
console.log(str);
|
|
111
|
-
console.log(
|
|
116
|
+
console.log(`ChromeDriver is already available at '${chromedriverBinaryFilePath}'.`);
|
|
112
117
|
return deferred.resolve(true);
|
|
113
118
|
}
|
|
114
119
|
deferred.resolve(false);
|
|
@@ -131,7 +136,9 @@ function findSuitableTempDirectory() {
|
|
|
131
136
|
|
|
132
137
|
for (let i = 0; i < candidateTmpDirs.length; i++) {
|
|
133
138
|
if (!candidateTmpDirs[i]) continue;
|
|
134
|
-
|
|
139
|
+
// Prevent collision with other versions in the dependency tree
|
|
140
|
+
const namespace = chromedriver_version;
|
|
141
|
+
const candidatePath = path.join(candidateTmpDirs[i], namespace, 'chromedriver');
|
|
135
142
|
try {
|
|
136
143
|
mkdirp.sync(candidatePath, '0777');
|
|
137
144
|
const testFile = path.join(candidatePath, now + '.tmp');
|
package/lib/chromedriver.js
CHANGED
|
@@ -17,7 +17,7 @@ function getPortFromArgs(args) {
|
|
|
17
17
|
}
|
|
18
18
|
process.env.PATH = path.join(__dirname, 'chromedriver') + path.delimiter + process.env.PATH;
|
|
19
19
|
exports.path = process.platform === 'win32' ? path.join(__dirname, 'chromedriver', 'chromedriver.exe') : path.join(__dirname, 'chromedriver', 'chromedriver');
|
|
20
|
-
exports.version = '2.
|
|
20
|
+
exports.version = '2.46';
|
|
21
21
|
exports.start = function(args, returnPromise) {
|
|
22
22
|
let command = exports.path;
|
|
23
23
|
if (!fs.existsSync(command)) {
|