diff --git a/edge.js b/edge.js index c175704..77ff1f8 100644 --- a/edge.js +++ b/edge.js @@ -63,7 +63,7 @@ class EdgeWebDriverInstaller extends WebDriverInstallerBase { * @return {!Promise} */ async getBestDriverVersion(browserVersion) { - const idealMajorVersion = parseInt(browserVersion.split('.')[0], 10); + let idealMajorVersion = parseInt(browserVersion.split('.')[0], 10); let platform; if (os.platform() == 'linux') { @@ -80,6 +80,16 @@ class EdgeWebDriverInstaller extends WebDriverInstallerBase { return `${CDN_URL}/LATEST_RELEASE_${majorVersion}_${platform}`; }; + // Work around https://github.com/MicrosoftEdge/EdgeWebDriver/issues/102, + // in which Linux versions of msedgedriver launch Chrome instead of Edge + // starting with version 115. For now, driver version 114 is working for + // Edge 115 on Linux. + if (os.platform() == 'linux') { + if (idealMajorVersion > 114) { + idealMajorVersion = 114; + } + } + return await InstallerUtils.fetchVersionUrlWithAutomaticDowngrade( idealMajorVersion, /* minMajorVersion */ idealMajorVersion - 2,