Skip to content

Commit

Permalink
fix: Choose platform-specific msedgedriver version (#8)
Browse files Browse the repository at this point in the history
When Edge pushes out a new stable release, the latest driver version
may actually vary between platforms.  This modifies the driver version
logic for Edge to pull a platform-specific file to determine what the
latest version is for that specific platform.
  • Loading branch information
joeyparrish authored Feb 11, 2022
1 parent be313db commit 2e0e859
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,19 @@ class EdgeWebDriverInstaller extends WebDriverInstallerBase {
*/
async getBestDriverVersion(browserVersion) {
const majorVersion = browserVersion.split('.')[0];
const versionUrl = `${CDN_URL}/LATEST_RELEASE_${majorVersion}`;

let platform;
if (os.platform() == 'linux') {
platform = 'LINUX';
} else if (os.platform() == 'darwin') {
platform = 'MACOS';
} else if (os.platform() == 'win32') {
platform = 'WINDOWS';
} else {
throw new Error(`Unrecognized platform: ${os.platform()}`);
}

const versionUrl = `${CDN_URL}/LATEST_RELEASE_${majorVersion}_${platform}`;
return await InstallerUtils.fetchVersionUrl(versionUrl, 'UTF-16LE');
}

Expand Down

0 comments on commit 2e0e859

Please sign in to comment.