Skip to content

Commit e86c645

Browse files
committed
Fixed Opera (post-blink) private mode (closes #35)
1 parent 9ed45c7 commit e86c645

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

BrowserSelect/Browser.cs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class Browser
1616
public string name;
1717
public string exec;
1818
public Icon icon;
19-
public string additionalArgs="";
19+
public string additionalArgs = "";
2020

2121
public string private_arg
2222
{
@@ -31,18 +31,14 @@ public string private_arg
3131
return "-private";
3232
if (file.Contains("edge"))
3333
return "-private";
34+
if (file.Contains("launcher"))
35+
return "-private";
3436
return "-private-window"; // FF
3537
}
3638
}
3739

38-
public List<char> shortcuts
39-
{
40-
get
41-
{
42-
// a one liner it is
43-
return Regex.Replace(this.name, @"[^A-Za-z\s]", "").Split(new[] { ' ' }).Select(x => x.Substring(0, 1).ToLower()[0]).ToList();
44-
}
45-
}
40+
public List<char> shortcuts => Regex.Replace(name, @"[^A-Za-z\s]", "").Split(' ')
41+
.Where(x => !string.IsNullOrWhiteSpace(x)).Select(x => x.Substring(0, 1).ToLower()[0]).ToList();
4642
public override string ToString()
4743
{
4844
return name;
@@ -100,7 +96,7 @@ public static List<Browser> find()
10096
{
10197
string ChromeUserDataDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Google\Chrome\User Data");
10298
List<string> ChromeProfiles = FindChromeProfiles(ChromeUserDataDir);
103-
99+
104100
if (ChromeProfiles.Count > 1)
105101
{
106102
//add the Chrome instances and remove the default one
@@ -132,9 +128,9 @@ private static List<string> FindChromeProfiles(string ChromeUserDataDir)
132128
{
133129
List<string> Profiles = new List<string>();
134130
var ProfileDirs = Directory.GetFiles(ChromeUserDataDir, "Google Profile.ico", SearchOption.AllDirectories).Select(Path.GetDirectoryName);
135-
foreach(var Profile in ProfileDirs)
131+
foreach (var Profile in ProfileDirs)
136132
{
137-
Profiles.Add(Profile.Substring(ChromeUserDataDir.Length+1));
133+
Profiles.Add(Profile.Substring(ChromeUserDataDir.Length + 1));
138134
}
139135
return Profiles;
140136
}
@@ -159,10 +155,10 @@ private static List<Browser> find(RegistryKey hklm)
159155

160156
//0. check if it can handle the http protocol
161157
var capabilities = key.OpenSubKey("Capabilities");
162-
// IE does not have the capabilities subkey...
163-
// so assume that the app can handle http if it doesn't
164-
// advertise it's capablities
165-
if(capabilities != null)
158+
// IE does not have the capabilities subkey...
159+
// so assume that the app can handle http if it doesn't
160+
// advertise it's capablities
161+
if (capabilities != null)
166162
if ((string)capabilities.OpenSubKey("URLAssociations").GetValue("http") == null)
167163
continue;
168164
//1. check if path is not empty

BrowserSelect/Form1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private void browser_click(object sender, EventArgs e)
202202
public static void open_url(Browser b, bool incognito = false)
203203
{
204204
var args = new List<string>();
205-
if (!String.IsNullOrEmpty(b.additionalArgs))
205+
if (!string.IsNullOrEmpty(b.additionalArgs))
206206
args.Add(b.additionalArgs);
207207
if (incognito)
208208
args.Add(b.private_arg);

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ it has been tested on windows 7, windows 8.1 and windows 10. requires **.net fra
1818

1919
# Download
2020

21-
you can download browser select here : [Browser select v1.3.9 (205KB)](https://github.com/zumoshi/BrowserSelect/releases/download/1.3.9/BrowserSelect.exe)
21+
you can download browser select here : [Browser select v1.4.0 (411KB)](https://github.com/zumoshi/BrowserSelect/releases/download/1.4.0/BrowserSelect.exe)
2222

2323
[![100% safe Award from softpedia](http://s1.softpedia-static.com/_img/sp100free.png?1)](http://www.softpedia.com/get/Internet/Browsers/Browser-Select.shtml#status)
2424

@@ -74,6 +74,11 @@ just a list of some ideas that can be integrated into BrowserSelect.
7474

7575
# Changelog
7676

77+
v1.4.0 [12/06/18]
78+
- Fixed Opera (post-blink) private mode (#35)
79+
- Chrome profiles are now listed as separate options (#29)
80+
(special thanks to [kueswol](https://github.com/kueswol) for his pull request)
81+
7782
v1.3.9 [06/04/18]
7883
- Fixed Edge private mode (#34)
7984
- Added Alt as alternative to shift for open in private/incognito mode (#33)

0 commit comments

Comments
 (0)