Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edge dev detection, Add edge channel detection #81

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion lib/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,26 @@ 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')
},

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.
const reg = /Edge ?([a-zA-Z]*)\\Application\\msedge\.exe/
const result = b.path.match(reg)
if (!result) return b

const channel = result[1].trim().toLowerCase()
if (channel === 'beta' || channel === 'dev') b.channel = channel
else b.channel = 'stable'

return b
}
}

Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down