Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
gord5500 committed Sep 24, 2024
1 parent e07c26d commit 5bf12bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/D2L.Bmx/Browser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public static class Browser {

// https://github.com/microsoft/playwright/blob/6763d5ab6bd20f1f0fc879537855a26c7644a496/packages/playwright-core/src/server/registry/index.ts#L457-L459
private static readonly string[] WindowsPartialPaths = [
"\\Microsoft\\Edge\\Application\\msedge.exe",
"\\Google\\Chrome\\Application\\chrome.exe",
"Microsoft\\Edge\\Application\\msedge.exe",
"Google\\Chrome\\Application\\chrome.exe",
];
private static readonly string[] MacPaths = [
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
Expand Down Expand Up @@ -45,17 +45,17 @@ public static class Browser {
foreach( string environmentVariable in WindowsEnvironmentVariables ) {
string? prefix = Environment.GetEnvironmentVariable( environmentVariable );
if( prefix is not null ) {
string path = prefix + windowsPartialPath;
string path = Path.Join( prefix, windowsPartialPath );
if( File.Exists( path ) ) {
return path;
}
}
}
}
} else if( OperatingSystem.IsMacOS() ) {
return MacPaths.First( File.Exists );
return Array.Find( MacPaths, File.Exists );
} else if( OperatingSystem.IsLinux() ) {
return LinuxPaths.First( File.Exists );
return Array.Find( LinuxPaths, File.Exists );
}
return null;
}
Expand Down
1 change: 1 addition & 0 deletions src/D2L.Bmx/ParentProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ internal partial class ParentProcess {
[LibraryImport( "libc", EntryPoint = "getppid" )]
private static partial int GetPosixParentProcessId();


// Uses the same approach of calling NtQueryInformationProcess as in the PowerShell library
// https://github.com/PowerShell/PowerShell/blob/26f621952910e33840efb0c539fbef1e2a467a0d/src/System.Management.Automation/engine/ProcessCodeMethods.cs
private static int GetWindowsParentProcessId() {
Expand Down

0 comments on commit 5bf12bd

Please sign in to comment.