Skip to content

Commit

Permalink
Add open.apps.edge (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed May 22, 2021
1 parent 18b9665 commit aff3e84
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ declare namespace open {

type AppName =
| 'chrome'
| 'firefox';
| 'firefox'
| 'edge';

type App = {
name: string | readonly string[];
Expand Down
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ defineLazyProperty(apps, 'firefox', () => detectPlatformBinary({
wsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe'
}));

defineLazyProperty(apps, 'edge', () => detectPlatformBinary({
darwin: 'microsoft edge',
win32: 'msedge',
linux: 'microsoft-edge'
}, {
wsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
}));

open.apps = apps;

module.exports = open;
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ await open('https://google.com', {

- [`chrome`](https://www.google.com/chrome) - Web browser
- [`firefox`](https://www.mozilla.org/firefox) - Web browser
- [`edge`](https://www.microsoft.com/edge) - Web browser

## Caveats

Expand Down
2 changes: 1 addition & 1 deletion xdg-open
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ open_generic()
if [ x"$BROWSER" = x"" ]; then
BROWSER=www-browser:links2:elinks:links:lynx:w3m
if has_display; then
BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium:chromium-browser:google-chrome:$BROWSER
BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium:chromium-browser:google-chrome:microsoft-edge:$BROWSER
fi
fi

Expand Down

0 comments on commit aff3e84

Please sign in to comment.