chromedriver 2.45.0 → 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 +9 -3
- 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;
|
|
@@ -132,7 +136,9 @@ function findSuitableTempDirectory() {
|
|
|
132
136
|
|
|
133
137
|
for (let i = 0; i < candidateTmpDirs.length; i++) {
|
|
134
138
|
if (!candidateTmpDirs[i]) continue;
|
|
135
|
-
|
|
139
|
+
// Prevent collision with other versions in the dependency tree
|
|
140
|
+
const namespace = chromedriver_version;
|
|
141
|
+
const candidatePath = path.join(candidateTmpDirs[i], namespace, 'chromedriver');
|
|
136
142
|
try {
|
|
137
143
|
mkdirp.sync(candidatePath, '0777');
|
|
138
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)) {
|