@@ -17,7 +17,8 @@ public enum PreferredBrowser
17
17
{
18
18
Edge ,
19
19
Chrome ,
20
- EdgeDev
20
+ EdgeDev ,
21
+ EdgeBeta
21
22
}
22
23
23
24
public class DevToolsPluginConfiguration
@@ -82,6 +83,7 @@ private string GetBrowserPath(DevToolsPluginConfiguration configuration)
82
83
PreferredBrowser . Chrome => Environment . ExpandEnvironmentVariables ( @"%ProgramFiles%\Google\Chrome\Application\chrome.exe" ) ,
83
84
PreferredBrowser . Edge => Environment . ExpandEnvironmentVariables ( @"%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe" ) ,
84
85
PreferredBrowser . EdgeDev => Environment . ExpandEnvironmentVariables ( @"%ProgramFiles(x86)%\Microsoft\Edge Dev\Application\msedge.exe" ) ,
86
+ PreferredBrowser . EdgeBeta => Environment . ExpandEnvironmentVariables ( @"%ProgramFiles(x86)%\Microsoft\Edge Beta\Application\msedge.exe" ) ,
85
87
_ => throw new NotSupportedException ( $ "{ configuration . PreferredBrowser } is an unsupported browser. Please change your PreferredBrowser setting for { Name } .")
86
88
} ;
87
89
}
@@ -92,6 +94,7 @@ private string GetBrowserPath(DevToolsPluginConfiguration configuration)
92
94
PreferredBrowser . Chrome => "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ,
93
95
PreferredBrowser . Edge => "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" ,
94
96
PreferredBrowser . EdgeDev => "/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev" ,
97
+ PreferredBrowser . EdgeBeta => "/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Beta" ,
95
98
_ => throw new NotSupportedException ( $ "{ configuration . PreferredBrowser } is an unsupported browser. Please change your PreferredBrowser setting for { Name } .")
96
99
} ;
97
100
}
@@ -102,6 +105,7 @@ private string GetBrowserPath(DevToolsPluginConfiguration configuration)
102
105
PreferredBrowser . Chrome => "/opt/google/chrome/chrome" ,
103
106
PreferredBrowser . Edge => "/opt/microsoft/msedge/msedge" ,
104
107
PreferredBrowser . EdgeDev => "/opt/microsoft/msedge-dev/msedge" ,
108
+ PreferredBrowser . EdgeBeta => "/opt/microsoft/msedge-beta/msedge" ,
105
109
_ => throw new NotSupportedException ( $ "{ configuration . PreferredBrowser } is an unsupported browser. Please change your PreferredBrowser setting for { Name } .")
106
110
} ;
107
111
}
@@ -113,9 +117,17 @@ private string GetBrowserPath(DevToolsPluginConfiguration configuration)
113
117
114
118
private Process [ ] GetBrowserProcesses ( string browserPath )
115
119
{
116
- return Process . GetProcesses ( ) . Where ( p =>
117
- p . MainModule is not null && p . MainModule . FileName == browserPath
118
- ) . ToArray ( ) ;
120
+ return Process . GetProcesses ( ) . Where ( p => {
121
+ try
122
+ {
123
+ return p . MainModule is not null && p . MainModule . FileName == browserPath ;
124
+ }
125
+ catch ( Exception ex )
126
+ {
127
+ Logger . LogDebug ( "Error while checking process: {Ex}" , ex . Message ) ;
128
+ return false ;
129
+ }
130
+ } ) . ToArray ( ) ;
119
131
}
120
132
121
133
private void InitInspector ( )
0 commit comments