Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: giggio/node-chromedriver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 117.0.0
Choose a base ref
...
head repository: giggio/node-chromedriver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 117.0.1
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Sep 19, 2023

  1. Fix install from pre-installed binary

    Fixes #424
    giggio committed Sep 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1e4d2bc View commit details
Showing with 8 additions and 8 deletions.
  1. +5 −5 install.js
  2. +2 −2 package-lock.json
  3. +1 −1 package.json
10 changes: 5 additions & 5 deletions install.js
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ if (skipDownload) {
const majorVersion = parseInt(chromedriverVersion.split('.')[0]);
const useLegacyMethod = majorVersion <= 114;
const platform = getPlatform(chromedriverVersion);
const downloadedFile = getDownloadFilePath(useLegacyMethod, tmpPath, platform);
let downloadedFile = getDownloadFilePath(useLegacyMethod, tmpPath, platform);
if (!useLegacyMethod) {
tmpPath = path.join(tmpPath, path.basename(downloadedFile, path.extname(downloadedFile)));
}
@@ -64,7 +64,7 @@ if (skipDownload) {
if (!chromedriverIsAvailable) {
console.log('Current existing ChromeDriver binary is unavailable, proceeding with download and extraction.');
const cdnBinariesUrl = (process.env.npm_config_chromedriver_cdnbinariesurl || process.env.CHROMEDRIVER_CDNBINARIESURL || 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing').replace(/\/+$/, '');
await downloadFile(useLegacyMethod ? legacyCdnUrl : cdnBinariesUrl, useLegacyMethod, downloadedFile, chromedriverVersion, platform, detectChromedriverVersion);
downloadedFile = await downloadFile(useLegacyMethod ? legacyCdnUrl : cdnBinariesUrl, useLegacyMethod, downloadedFile, chromedriverVersion, platform);
await extractDownload(extractDirectory, chromedriverBinaryFilePath, downloadedFile);
}
const libPath = path.join(__dirname, 'lib', 'chromedriver');
@@ -115,11 +115,10 @@ function getPlatform(chromedriverVersion) {
* @param {string} downloadedFile
* @param {string} chromedriverVersion
* @param {string} platform
* @param {boolean} detectChromedriverVersion
*/
async function downloadFile(cdnUrl, useLegacyDownloadMethod, downloadedFile, chromedriverVersion, platform, detectChromedriverVersion) {
async function downloadFile(cdnUrl, useLegacyDownloadMethod, downloadedFile, chromedriverVersion, platform) {
const configuredfilePath = process.env.npm_config_chromedriver_filepath || process.env.CHROMEDRIVER_FILEPATH;
if (detectChromedriverVersion && configuredfilePath) {
if (configuredfilePath) {
console.log('Using file: ', configuredfilePath);
return configuredfilePath;
} else {
@@ -133,6 +132,7 @@ async function downloadFile(cdnUrl, useLegacyDownloadMethod, downloadedFile, chr
console.log('Downloading from file: ', formattedDownloadUrl);
await requestBinary(getRequestOptions(formattedDownloadUrl), downloadedFile);
}
return downloadedFile;
}
}

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chromedriver",
"version": "117.0.0",
"version": "117.0.1",
"keywords": [
"chromedriver",
"selenium"