Skip to content

Commit

Permalink
Fix Min-Browser Version Comparison (#886)
Browse files Browse the repository at this point in the history
* Fix Min-Browser Version Comparison

This patch fixes a bug with the version comparison logic used to
determine which revision of the DevTools frontend to fetch from the CDN.

The previous version comparison logic did not appropriately cast to int
the product could get into a situation where browser version "100" > min_ver.

* Linting
  • Loading branch information
hkal authored Feb 16, 2022
1 parent 8bed31b commit 169d980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/versionSocketConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export class BrowserVersionDetectionSocket extends EventEmitter {
const productParts = (data.result.product as string).split('/');
const isHeadless = productParts[0].includes('Headless');
const versionNum = productParts[1];
const currentVersion = versionNum.split('.');
const minSupportedVersion = MIN_SUPPORTED_VERSION.split('.');
const currentVersion = versionNum.split('.').map(part => Number(part));
const minSupportedVersion = MIN_SUPPORTED_VERSION.split('.').map(part => Number(part));
const currentRevision = data.result.revision || '';
for (let i = 0; i < currentVersion.length; i++) {
// Loop through from Major to minor numbers
Expand Down

0 comments on commit 169d980

Please sign in to comment.