Skip to content

Improve perf and fix permission denied errors with latest Chrome releases #96

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

Open
wants to merge 2 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
7 changes: 4 additions & 3 deletions BrowserSelect/Browser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,11 @@ private static string GetChromeProfileName(string FullProfilePath)
private static List<string> FindChromeProfiles(string ChromeUserDataDir, string IconFilename)
{
List<string> Profiles = new List<string>();
var ProfileDirs = Directory.GetFiles(ChromeUserDataDir, IconFilename, SearchOption.AllDirectories).Select(Path.GetDirectoryName);
foreach (var Profile in ProfileDirs)
var TopLevelDirs = Directory.GetDirectories(ChromeUserDataDir);
foreach (var Dir in TopLevelDirs)
{
Profiles.Add(Profile.Substring(ChromeUserDataDir.Length + 1));
var BaseName = Dir.Substring(ChromeUserDataDir.Length + 1);
if (File.Exists(Dir + "\\" + IconFilename)) { Profiles.Add(BaseName); }
}
return Profiles;
}
Expand Down
2 changes: 1 addition & 1 deletion BrowserSelect/ForegroundAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ForegroundAgent
/// also gives said window focus (setForegroundWindow)
/// </summary>
/// <param name="hwnd">hWnd of window to be restored</param>
public static void RestoreWindow(int hwnd)
public static void RestoreWindow(long hwnd)
{

var hWnd = new IntPtr(hwnd);
Expand Down