From 0536f83665d4346f459cbe1820058aa35747c717 Mon Sep 17 00:00:00 2001 From: Temm Date: Fri, 31 Mar 2023 15:37:14 +0200 Subject: [PATCH 1/3] Fix edge dev detection --- lib/browsers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/browsers.js b/lib/browsers.js index 4c6315f..c26445d 100644 --- a/lib/browsers.js +++ b/lib/browsers.js @@ -115,8 +115,11 @@ exports.msedge = { find: function () { this.programFiles('Microsoft\\Edge Beta\\Application') + this.programFiles('Microsoft\\Edge Dev\\Application') this.programFiles('Microsoft\\Edge\\Application') - this.startMenu() + this.startMenu("Microsoft Edge") + this.startMenu("Microsoft Edge Dev") + this.startMenu("Microsoft Edge Beta") } } From a74725274e02ef6b67faf1225bc0ff1a19d022ae Mon Sep 17 00:00:00 2001 From: Temm Date: Fri, 31 Mar 2023 15:37:53 +0200 Subject: [PATCH 2/3] Add edge channel detection --- lib/browsers.js | 15 +++++++++++++++ readme.md | 1 + 2 files changed, 16 insertions(+) diff --git a/lib/browsers.js b/lib/browsers.js index c26445d..3faa452 100644 --- a/lib/browsers.js +++ b/lib/browsers.js @@ -120,6 +120,21 @@ exports.msedge = { this.startMenu("Microsoft Edge") this.startMenu("Microsoft Edge Dev") this.startMenu("Microsoft Edge Beta") + }, + + post: function (b) { + // The channel is not actually in the metadata of the edge binary. + // We could read the "msedge.VisualElementsManifest.xml" file to find the channel, but that may be slow. + // Instead, we try to to find the channel from the installation folder. + let reg = /Edge ?([a-zA-Z]*)\\Application\\msedge\.exe/; + let result = b.path.match(reg); + if (!result) return b; + + let channel = result[1].trim().toLowerCase(); + if (channel === 'beta' || channel === 'dev') b.channel = channel + else b.channel = 'stable' + + return b } } diff --git a/readme.md b/readme.md index a9f5d53..9d7e871 100644 --- a/readme.md +++ b/readme.md @@ -71,6 +71,7 @@ Additional properties are usually available but not guaranteed: - Firefox: `release`, `developer`, `nightly` or [`esr`](https://www.mozilla.org/en-US/firefox/organizations/faq/) - Older versions of Firefox: `aurora`, `beta` or `rc`; - Opera: `stable`, `beta` or `developer`. + - Edge: `stable`, `beta` or `dev` ## CLI From 57757c1a26cac032c5a91eb8f74e9d722232ec8b Mon Sep 17 00:00:00 2001 From: Temm Date: Fri, 31 Mar 2023 22:20:01 +0200 Subject: [PATCH 3/3] Fix code style --- lib/browsers.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/browsers.js b/lib/browsers.js index 3faa452..f4d1ee1 100644 --- a/lib/browsers.js +++ b/lib/browsers.js @@ -117,20 +117,20 @@ exports.msedge = { this.programFiles('Microsoft\\Edge Beta\\Application') this.programFiles('Microsoft\\Edge Dev\\Application') this.programFiles('Microsoft\\Edge\\Application') - this.startMenu("Microsoft Edge") - this.startMenu("Microsoft Edge Dev") - this.startMenu("Microsoft Edge Beta") + this.startMenu('Microsoft Edge') + this.startMenu('Microsoft Edge Dev') + this.startMenu('Microsoft Edge Beta') }, post: function (b) { // The channel is not actually in the metadata of the edge binary. // We could read the "msedge.VisualElementsManifest.xml" file to find the channel, but that may be slow. // Instead, we try to to find the channel from the installation folder. - let reg = /Edge ?([a-zA-Z]*)\\Application\\msedge\.exe/; - let result = b.path.match(reg); - if (!result) return b; + const reg = /Edge ?([a-zA-Z]*)\\Application\\msedge\.exe/ + const result = b.path.match(reg) + if (!result) return b - let channel = result[1].trim().toLowerCase(); + const channel = result[1].trim().toLowerCase() if (channel === 'beta' || channel === 'dev') b.channel = channel else b.channel = 'stable'