chromedriver 123.0.2 → 123.0.3
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/install.js +7 -6
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -52,7 +52,7 @@ class Installer {
|
|
|
52
52
|
const majorVersion = parseInt(chromedriverVersion.split('.')[0]);
|
|
53
53
|
const useLegacyMethod = majorVersion <= 114;
|
|
54
54
|
const platform = this.getPlatform(chromedriverVersion);
|
|
55
|
-
|
|
55
|
+
let downloadedFile = this.getDownloadFilePath(useLegacyMethod, tmpPath, platform);
|
|
56
56
|
if (!useLegacyMethod)
|
|
57
57
|
tmpPath = path.join(tmpPath, path.basename(downloadedFile, path.extname(downloadedFile)));
|
|
58
58
|
const chromedriverBinaryFileName = process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver';
|
|
@@ -63,12 +63,13 @@ class Installer {
|
|
|
63
63
|
const configuredfilePath = process.env.npm_config_chromedriver_filepath || process.env.CHROMEDRIVER_FILEPATH;
|
|
64
64
|
if (configuredfilePath) {
|
|
65
65
|
console.log('Using file: ', configuredfilePath);
|
|
66
|
-
|
|
66
|
+
downloadedFile = configuredfilePath;
|
|
67
|
+
} else {
|
|
68
|
+
if (useLegacyMethod)
|
|
69
|
+
await this.downloadFileLegacy(legacyCdnUrl, downloadedFile, chromedriverVersion);
|
|
70
|
+
else
|
|
71
|
+
await this.downloadFile(cdnUrl, downloadedFile, chromedriverVersion, platform);
|
|
67
72
|
}
|
|
68
|
-
if (useLegacyMethod)
|
|
69
|
-
await this.downloadFileLegacy(legacyCdnUrl, downloadedFile, chromedriverVersion);
|
|
70
|
-
else
|
|
71
|
-
await this.downloadFile(cdnUrl, downloadedFile, chromedriverVersion, platform);
|
|
72
73
|
await this.extractDownload(extractDirectory, chromedriverBinaryFilePath, downloadedFile);
|
|
73
74
|
}
|
|
74
75
|
const libPath = path.join(__dirname, 'lib', 'chromedriver');
|