chromedriver
Advanced tools
Comparing version 107.0.1 to 107.0.2
@@ -6,5 +6,4 @@ 'use strict'; | ||
const helper = require('./lib/chromedriver'); | ||
const axios = require('axios').default; | ||
const axios = require('axios'); | ||
const path = require('path'); | ||
const del = require('del'); | ||
const child_process = require('child_process'); | ||
@@ -49,5 +48,8 @@ const os = require('os'); | ||
console.log("Your Chrome version is " + chromeVersion); | ||
const chromeVersionWithoutPatch = /^(.*?)\.\d+$/.exec(chromeVersion)[1]; | ||
await getChromeDriverVersion(getRequestOptions(cdnUrl + '/LATEST_RELEASE_' + chromeVersionWithoutPatch)); | ||
console.log("Compatible ChromeDriver version is " + chromedriver_version); | ||
const versionMatch = /^(.*?)\.\d+$/.exec(chromeVersion); | ||
if (versionMatch) { | ||
const chromeVersionWithoutPatch = versionMatch[1]; | ||
await getChromeDriverVersion(getRequestOptions(cdnUrl + '/LATEST_RELEASE_' + chromeVersionWithoutPatch)); | ||
console.log("Compatible ChromeDriver version is " + chromedriver_version); | ||
} | ||
} | ||
@@ -168,7 +170,6 @@ if (chromedriver_version === 'LATEST') { | ||
for (let i = 0; i < candidateTmpDirs.length; i++) { | ||
if (!candidateTmpDirs[i]) continue; | ||
// Prevent collision with other versions in the dependency tree | ||
for (const tempDir of candidateTmpDirs) { | ||
if (!tempDir) continue; | ||
const namespace = chromedriver_version; | ||
const candidatePath = path.join(candidateTmpDirs[i], namespace, 'chromedriver'); | ||
const candidatePath = path.join(tempDir, namespace, 'chromedriver'); | ||
try { | ||
@@ -197,7 +198,8 @@ fs.mkdirSync(candidatePath, { recursive: true }); | ||
const proxyUrlParts = url.parse(proxyUrl); | ||
options.proxy = { | ||
host: proxyUrlParts.hostname, | ||
port: proxyUrlParts.port ? parseInt(proxyUrlParts.port) : 80, | ||
protocol: proxyUrlParts.protocol | ||
}; | ||
if (proxyUrlParts.hostname && proxyUrlParts.protocol) | ||
options.proxy = { | ||
host: proxyUrlParts.hostname, | ||
port: proxyUrlParts.port ? parseInt(proxyUrlParts.port) : 80, | ||
protocol: proxyUrlParts.protocol | ||
}; | ||
} | ||
@@ -252,3 +254,3 @@ | ||
console.log('Finding Chromedriver version.'); | ||
const response = await axios(requestOptions); | ||
const response = await axios.request(requestOptions); | ||
chromedriver_version = response.data.trim(); | ||
@@ -267,3 +269,3 @@ console.log(`Chromedriver version is ${chromedriver_version}.`); | ||
try { | ||
response = await axios({ responseType: 'stream', ...requestOptions }); | ||
response = await axios.request({ responseType: 'stream', ...requestOptions }); | ||
} catch (error) { | ||
@@ -276,3 +278,3 @@ if (error && error.response) { | ||
try { | ||
await finishedAsync(error.response.data) | ||
await finishedAsync(error.response.data); | ||
} catch (error) { | ||
@@ -317,3 +319,3 @@ console.error('Error downloading entire response:', error); | ||
async function copyIntoPlace(originPath, targetPath) { | ||
await del(targetPath, { force: true }); | ||
fs.rmSync(targetPath, { recursive: true, force: true }); | ||
console.log(`Copying from ${originPath} to target path ${targetPath}`); | ||
@@ -327,3 +329,3 @@ fs.mkdirSync(targetPath); | ||
const promises = files.map(name => { | ||
return new Promise((resolve) => { | ||
return /** @type {Promise<void>} */(new Promise((resolve) => { | ||
const file = path.join(originPath, name); | ||
@@ -335,3 +337,3 @@ const reader = fs.createReadStream(file); | ||
reader.pipe(writer); | ||
}); | ||
})); | ||
}); | ||
@@ -360,3 +362,3 @@ await Promise.all(promises); | ||
return 'mac_arm64' | ||
return 'mac_arm64'; | ||
} | ||
@@ -378,4 +380,4 @@ | ||
// When run with `-in`, the return code is 0 even if there is no `sysctl.proc_translated` | ||
if(proc.status) { | ||
throw new Error('Unexpected return code from sysctl: ' + proc.status); | ||
if (proc.status) { | ||
throw new Error('Unexpected return code from sysctl: ' + proc.status); | ||
} | ||
@@ -385,4 +387,4 @@ | ||
// stdout | ||
if(!proc.stdout) { | ||
return false | ||
if (!proc.stdout) { | ||
return false; | ||
} | ||
@@ -389,0 +391,0 @@ |
{ | ||
"name": "chromedriver", | ||
"version": "107.0.1", | ||
"version": "107.0.2", | ||
"keywords": [ | ||
@@ -26,9 +26,9 @@ "chromedriver", | ||
"install": "node install.js", | ||
"update-chromedriver": "node update.js" | ||
"update-chromedriver": "node update.js", | ||
"lint": "eslint" | ||
}, | ||
"dependencies": { | ||
"@testim/chrome-version": "^1.1.3", | ||
"axios": "^0.27.2", | ||
"axios": "^1.1.3", | ||
"compare-versions": "^5.0.1", | ||
"del": "^6.1.1", | ||
"extract-zip": "^2.0.1", | ||
@@ -39,2 +39,5 @@ "https-proxy-agent": "^5.0.1", | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.26.0" | ||
}, | ||
"engines": { | ||
@@ -41,0 +44,0 @@ "node": ">=10" |
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
37735
7
402
1
+ Addedaxios@1.7.7(transitive)
- Removeddel@^6.1.1
- Removed@nodelib/fs.scandir@2.1.5(transitive)
- Removed@nodelib/fs.stat@2.0.5(transitive)
- Removed@nodelib/fs.walk@1.2.8(transitive)
- Removedaggregate-error@3.1.0(transitive)
- Removedarray-union@2.1.0(transitive)
- Removedaxios@0.27.2(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@3.0.3(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddel@6.1.1(transitive)
- Removeddir-glob@3.0.1(transitive)
- Removedfast-glob@3.3.2(transitive)
- Removedfastq@1.17.1(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedglobby@11.1.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedignore@5.3.2(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedis-path-cwd@2.2.0(transitive)
- Removedis-path-inside@3.0.3(transitive)
- Removedmerge2@1.4.1(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedp-map@4.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-type@4.0.0(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedqueue-microtask@1.2.3(transitive)
- Removedreusify@1.0.4(transitive)
- Removedrimraf@3.0.2(transitive)
- Removedrun-parallel@1.2.0(transitive)
- Removedslash@3.0.0(transitive)
- Removedto-regex-range@5.0.1(transitive)
Updatedaxios@^1.1.3