@testim/chrome-version
Advanced tools
Comparing version 1.1.3 to 1.1.4
26
index.js
@@ -29,2 +29,4 @@ 'use strict'; | ||
const chromeVersionRegex = /^(\d+\.){3}\d+$/g; | ||
async function getChromeVersionWin(includeChromium) { | ||
@@ -39,2 +41,12 @@ | ||
const powershell = await execAndAttemptExtractingChromeVersion(`powershell -command "&{(Get-Item '${chromePath}').VersionInfo.ProductVersion}"`); | ||
if (powershell !== null) { | ||
return powershell; | ||
} | ||
const registry = await execAndAttemptExtractingChromeVersion('reg query "HKEY_CURRENT_USER\\Software\\Google\\Chrome\\BLBeacon" /v version'); | ||
if (registry !== null) { | ||
return registry; | ||
} | ||
const versionPath = path.dirname(chromePath); | ||
@@ -44,3 +56,3 @@ | ||
const versions = contents.filter(a => /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/g.test(a)); | ||
const versions = contents.filter(a => chromeVersionRegex.test(a)); | ||
@@ -53,2 +65,14 @@ // returning oldest in case there is an updated version and chrome still hasn't relaunched | ||
async function execAndAttemptExtractingChromeVersion(command) { | ||
try { | ||
const { stdout } = await exec(command); | ||
const version = extractChromeVersionNumer(stdout).trim(); | ||
if (chromeVersionRegex.test(version)) { | ||
return version; | ||
} | ||
} catch (err) { ''; } | ||
return null; | ||
} | ||
function getChromeVersionFromOsa(includeChromium) { | ||
@@ -55,0 +79,0 @@ |
{ | ||
"name": "@testim/chrome-version", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Finds the version of Chrome that is installed on your machine", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
33552
684