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

[WIP] - Support Microsoft Edge (Chromium Based) #4203

Closed
wants to merge 16 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -29,5 +29,21 @@ exports['browsers returns the expected list of browsers 1'] = [
"versionRegex": {},
"profile": true,
"binary": "google-chrome-canary"
},
{
"name":"edgeCanary",
"family":"chrome",
"displayName":"Edge Canary",
"versionRegex":{},
"profile":true,
"binary":"edge-canary"
},
{
"name":"edgeDev",
"family":"chrome",
"displayName":"Edge Dev",
"versionRegex":{},
"profile":true,
"binary":"edge-dev"
}
]
@@ -28,6 +28,22 @@ export const browsers: Browser[] = [
profile: true,
binary: 'google-chrome-canary',
},
{
name: 'edgeCanary',
family: 'chrome',
displayName: 'Edge Canary',
versionRegex: /Microsoft Edge Canary (\S+)/,
profile: true,
binary: 'edge-canary',
},
{
name: 'edgeDev',
family: 'chrome',
displayName: 'Edge Dev',
versionRegex: /Microsoft Edge Dev (\S+)/,
profile: true,
binary: 'edge-dev',
},
]

/** starts a found browser and opens URL if given one */
@@ -19,6 +19,16 @@ const detectChromium = partial(findApp, [
'org.chromium.Chromium',
'CFBundleShortVersionString',
])
const detectEdgeCanary = partial(findApp, [
'Contents/MacOS/Microsoft Edge Canary',
'com.microsoft.Edge.Canary',
'CFBundleShortVersionString',
])
const detectEdgeDev = partial(findApp, [
'Contents/MacOS/Microsoft Edge Dev',
'com.microsoft.Edge.Dev',
'CFBundleShortVersionString',
])

type Detectors = {
[index: string]: Function
@@ -28,6 +38,8 @@ const browsers: Detectors = {
chrome: detectChrome,
canary: detectCanary,
chromium: detectChromium,
edgeDev: detectEdgeDev,
edgeCanary: detectEdgeCanary,
}

export function getVersionString (path: string) {
@@ -34,19 +34,43 @@ function formChromeCanaryAppPath () {
return normalize(exe)
}

function formEdgeCanaryAppPath () {
const home = homedir()
const exe = join(
home,
'AppData',
'Local',
'Microsoft',
'Edge SxS',
'Application',
'msedge.exe'
)

return normalize(exe)
}

function formEdgeDevAppPath () {
const exe = 'C:/Program Files (x86)/Microsoft/Edge Dev/Application/msedge.exe'

return normalize(exe)
}
type NameToPath = (name: string) => string

interface WindowsBrowserPaths {
[index: string]: NameToPath
chrome: NameToPath
canary: NameToPath
chromium: NameToPath
edgeDev: NameToPath
edgeCanary: NameToPath
}

const formPaths: WindowsBrowserPaths = {
chrome: formFullAppPath,
canary: formChromeCanaryAppPath,
chromium: formChromiumAppPath,
edgeDev: formEdgeDevAppPath,
edgeCanary: formEdgeCanaryAppPath,
}

function getWindowsBrowser (name: string): Promise<FoundBrowser> {