diff --git a/BrowserSelect/Browser.cs b/BrowserSelect/Browser.cs index f6dc422..499917b 100644 --- a/BrowserSelect/Browser.cs +++ b/BrowserSelect/Browser.cs @@ -233,12 +233,13 @@ private static List find(RegistryKey hklm) icon = icon2String(IconExtractor.fromFile(exec)) }); } - catch (NullReferenceException) + catch (NullReferenceException ex) { + System.Diagnostics.Debug.WriteLine(ex); } // incomplete registry record for browser, ignore it catch (Exception ex) { - // todo: log errors + System.Diagnostics.Debug.WriteLine(ex); } } return browsers; diff --git a/BrowserSelect/BrowserSelect.csproj b/BrowserSelect/BrowserSelect.csproj index 497770e..4f9905f 100644 --- a/BrowserSelect/BrowserSelect.csproj +++ b/BrowserSelect/BrowserSelect.csproj @@ -9,8 +9,9 @@ Properties BrowserSelect BrowserSelect - v4.0 + v4.7.2 512 + AnyCPU @@ -21,6 +22,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -30,16 +32,21 @@ TRACE prompt 4 + false bs.ico - - ..\packages\Newtonsoft.Json.11.0.2\lib\net40\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + + @@ -70,6 +77,18 @@ Form1.cs + + Form + + + frm_settings_urlexpander.cs + + + Form + + + frm_SplashScreen.cs + Form @@ -110,6 +129,12 @@ Form1.cs + + frm_settings_urlexpander.cs + + + frm_SplashScreen.cs + frm_About.cs diff --git a/BrowserSelect/Form1.cs b/BrowserSelect/Form1.cs index 420c3e4..bae909a 100644 --- a/BrowserSelect/Form1.cs +++ b/BrowserSelect/Form1.cs @@ -50,15 +50,18 @@ public void updateBrowsers() } private void Form1_Load(object sender, EventArgs e) - { + { this.AutoSize = true; this.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.KeyPreview = true; - this.Text = Program.url; // set the form icon from .exe file icon this.Icon = IconExtractor.fromFile(Application.ExecutablePath); // create a wildcard rule for this domain (always button) - _alwaysRule = generate_rule(Program.url); + if (Program.url != "") + { + _alwaysRule = generate_rule(Program.url); + this.Text = Program.url; + } // check for new version if (Settings.Default.last_version != "nope") { @@ -161,7 +164,9 @@ e.g. sealake.vic.au or something.fun.ir x = parts[count - 2]; //second-level y = parts[count - 3]; //third-level } - catch (IndexOutOfRangeException) { } // in case domain did not have 3 parts.. (e.g. localhost, google.com) + catch (IndexOutOfRangeException ex) { + Debug.WriteLine(ex); + } // in case domain did not have 3 parts.. (e.g. localhost, google.com) // creating the patterns var rule_tld = String.Format("*.{0}.{1}", x, tld); diff --git a/BrowserSelect/Program.cs b/BrowserSelect/Program.cs index 8239032..ca6576a 100644 --- a/BrowserSelect/Program.cs +++ b/BrowserSelect/Program.cs @@ -7,12 +7,23 @@ using System.Threading.Tasks; using System.Windows.Forms; using BrowserSelect.Properties; +using System.Web; +using System.Net; +using System.Threading; namespace BrowserSelect { static class Program { - public static string url = "http://google.com/"; + public static string url = ""; + public static HttpWebRequest webRequestThread = null; + public static bool uriExpanderThreadStop = false; + public static (string name, string domain)[] defaultUriExpander = new(string name, string domain)[] + { + ("Outlook safe links", "safelinks.protection.outlook.com")//, + //("Test1", "test.com"), + //("Test2", "test2.com") + }; /// /// The main entry point for the application. @@ -20,7 +31,6 @@ static class Program [STAThread] static void Main(string[] args) { - // fix #28 LeaveDotsAndSlashesEscaped(); // to prevent loss of settings when on update @@ -43,6 +53,35 @@ static void Main(string[] args) var uc = new UpdateChecker(); Task.Factory.StartNew(() => uc.check()); } + //load URL Shortners + string[] defultUrlShortners = new string[] { + "adf.ly", + "bit.do", + "bit.ly", + "goo.gl", + "ht.ly", + "is.gd", + "ity.im", + "lnk.co", + "ow.ly", + "q.gs", + "rb.gy", + "rotf.lol", + "t.co", + "tiny.one", + "tinyurl.com" + }; + if (Settings.Default.URLShortners == null) + { + StringCollection url_shortners = new StringCollection(); + url_shortners.AddRange(defultUrlShortners); + Settings.Default.URLShortners = url_shortners; + Settings.Default.Save(); + } + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + //checking if a url is being opened or app is ran from start menu (without arguments) if (args.Length > 0) { @@ -50,6 +89,9 @@ static void Main(string[] args) url = args[0]; //add http:// to url if it is missing a protocol var uri = new UriBuilder(url).Uri; + uri = UriExpander(uri); + if (Settings.Default.ExpandUrl != null && Settings.Default.ExpandUrl != "Never") + uri = UriFollowRedirects(uri); url = uri.AbsoluteUri; foreach (var sr in Settings.Default.AutoBrowser.Cast() @@ -81,9 +123,12 @@ static void Main(string[] args) } // display main form - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + //Application.EnableVisualStyles(); + //Application.SetCompatibleTextRenderingDefault(false); + if (url == "" && (Boolean)Settings.Default.LaunchToSettings) + Application.Run(new frm_settings()); + else + Application.Run(new Form1()); } // from : http://stackoverflow.com/a/250400/1461004 @@ -207,5 +252,126 @@ private static void LeaveDotsAndSlashesEscaped() setUpdatableFlagsMethod.Invoke(uriParser, new object[] { 0 }); } + + private static Uri UriExpander(Uri uri) + { + List enabled_url_expanders = new List(); + if (Settings.Default.URLProcessors != null) + { + foreach ((string name, string domain) in defaultUriExpander) + { + if (Settings.Default.URLProcessors.Contains(name)) + { + enabled_url_expanders.Add(domain); + } + } + } + + System.Diagnostics.Debug.WriteLine("URLExpander: " + uri.Host); + if (uri.Host.EndsWith("safelinks.protection.outlook.com") && + enabled_url_expanders.Contains("safelinks.protection.outlook.com")) + { + var queryDict = HttpUtility.ParseQueryString(uri.Query); + if (queryDict != null && queryDict.Get("url") != null) + { + uri = new UriBuilder(HttpUtility.UrlDecode(queryDict.Get("url"))).Uri; + } + } + + return uri; + } + private static Uri UriFollowRedirects(Uri uri, int num_redirects = 0) + { + int max_redirects = 20; + if (num_redirects >= max_redirects) + { + return uri; + } + System.Diagnostics.Debug.WriteLine("Url " + num_redirects + " " + uri.Host); + StringCollection url_shortners = Settings.Default.URLShortners; + Form SplashScreen = null; + if (!Program.uriExpanderThreadStop && + (url_shortners.Contains(uri.Host) || Settings.Default.ExpandUrl == "Follow all redirects")) + { + //Thread.Sleep(2000); + if (num_redirects == 0) + { + SplashScreen = new frm_SplashScreen(); + var splashThread = new Thread(new ThreadStart(() => Application.Run(SplashScreen))); + splashThread.Start(); + } + HttpWebResponse response = MyWebRequest(uri); + if (response != null) + { + if ((int)response.StatusCode > 299 && (int)response.StatusCode < 400) + { + uri = UriFollowRedirects(new UriBuilder(response.Headers["Location"]).Uri, (num_redirects + 1)); + } + else + { + uri = response.ResponseUri; + } + } + } + + if (num_redirects == 0) + { + if (SplashScreen != null && !SplashScreen.Disposing && !SplashScreen.IsDisposed) + try + { + Program.uriExpanderThreadStop = true; + SplashScreen.Invoke(new Action(() => SplashScreen.Close())); + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine(ex); + } + } + return uri; + } + + private static HttpWebResponse MyWebRequest(Uri uri) + { + //Support TLS1.2 - updated .Net framework - no longer needed + //ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | (SecurityProtocolType)768 | (SecurityProtocolType)3072 | SecurityProtocolType.Ssl3; //SecurityProtocolType.Tls12; + var webRequest = (HttpWebRequest)WebRequest.Create(uri.AbsoluteUri); + // Set timeout - needs to be high enough for HTTP request to succeed on slow network connections, + // but fast enough not to slow down BrowserSelect startup too much. + // 2 seconds seems about right + webRequest.Timeout = 2000; + //webRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv: 85.0) Gecko/20100101 Firefox/85.0"; + webRequest.AllowAutoRedirect = false; + HttpWebResponse response = null; + try + { + var ar = webRequest.BeginGetResponse(null, null); + Program.webRequestThread = webRequest; + ThreadPool.RegisterWaitForSingleObject(ar.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), webRequest, webRequest.Timeout, true); + response = (HttpWebResponse)webRequest.EndGetResponse(ar); + response.Close(); + } + catch (WebException ex) + { + // We are mostly catch up webRequest.Abort() or webRequest errors here (e.g. untrusted certificates) + // No action required. + System.Diagnostics.Debug.WriteLine(ex); + } + + return response; + } + + // Abort the request if the timer fires. + private static void TimeoutCallback(object state, bool timedOut) + { + if (timedOut) + { + HttpWebRequest request = state as HttpWebRequest; + if (request != null) + { + System.Diagnostics.Debug.WriteLine("Timed out, aborting HTTP request..."); + request.Abort(); + } + } + } } } diff --git a/BrowserSelect/Properties/Resources.Designer.cs b/BrowserSelect/Properties/Resources.Designer.cs index 7326a8f..a95b47d 100644 --- a/BrowserSelect/Properties/Resources.Designer.cs +++ b/BrowserSelect/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace BrowserSelect.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/BrowserSelect/Properties/Settings.Designer.cs b/BrowserSelect/Properties/Settings.Designer.cs index b9cdc52..caf7bed 100644 --- a/BrowserSelect/Properties/Settings.Designer.cs +++ b/BrowserSelect/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace BrowserSelect.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -92,5 +92,51 @@ public string BrowserList { this["BrowserList"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("Never")] + public string ExpandUrl { + get { + return ((string)(this["ExpandUrl"])); + } + set { + this["ExpandUrl"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Collections.Specialized.StringCollection URLShortners { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["URLShortners"])); + } + set { + this["URLShortners"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Collections.Specialized.StringCollection URLProcessors { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["URLProcessors"])); + } + set { + this["URLProcessors"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool LaunchToSettings { + get { + return ((bool)(this["LaunchToSettings"])); + } + set { + this["LaunchToSettings"] = value; + } + } } } diff --git a/BrowserSelect/Properties/Settings.settings b/BrowserSelect/Properties/Settings.settings index 076050b..e88d40b 100644 --- a/BrowserSelect/Properties/Settings.settings +++ b/BrowserSelect/Properties/Settings.settings @@ -20,5 +20,17 @@ + + Never + + + + + + + + + False + \ No newline at end of file diff --git a/BrowserSelect/UpdateChecker.cs b/BrowserSelect/UpdateChecker.cs index 9ce5962..7ce49b1 100644 --- a/BrowserSelect/UpdateChecker.cs +++ b/BrowserSelect/UpdateChecker.cs @@ -36,7 +36,7 @@ string get_last_version() var req = (HttpWebRequest)WebRequest.Create("https://github.com/zumoshi/BrowserSelect/releases/latest"); // make webrequest use tls 1.2 instead of ssl3 (#43) ServicePointManager.Expect100Continue = true; - ServicePointManager.SecurityProtocol = (SecurityProtocolType)768 | (SecurityProtocolType)3072; + //ServicePointManager.SecurityProtocol = (SecurityProtocolType)768 | (SecurityProtocolType)3072; req.Method = "HEAD"; req.AllowAutoRedirect = false; using (var res = req.GetResponse()) @@ -53,7 +53,9 @@ void get_versions() current_version = ((Func)((x) => x.Substring(0, x.Length - 2)))(Application.ProductVersion); init = true; } - catch (Exception) { } + catch (Exception ex) { + System.Diagnostics.Debug.WriteLine(ex); + } } bool new_version() diff --git a/BrowserSelect/app.config b/BrowserSelect/app.config index 2ebf191..6088a2f 100644 --- a/BrowserSelect/app.config +++ b/BrowserSelect/app.config @@ -1,8 +1,8 @@ - + - -
+ +
@@ -19,6 +19,12 @@ + + Never + + + False + - \ No newline at end of file + diff --git a/BrowserSelect/frm_SplashScreen.Designer.cs b/BrowserSelect/frm_SplashScreen.Designer.cs new file mode 100644 index 0000000..8da7c94 --- /dev/null +++ b/BrowserSelect/frm_SplashScreen.Designer.cs @@ -0,0 +1,69 @@ + +namespace BrowserSelect +{ + partial class frm_SplashScreen + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frm_SplashScreen)); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(13, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(171, 17); + this.label1.TabIndex = 0; + this.label1.Text = "URL Expander - loading..."; + this.label1.UseWaitCursor = true; + // + // frm_SplashScreen + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(251, 69); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "frm_SplashScreen"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "BrowserSelect"; + this.UseWaitCursor = true; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frm_SplashScreen_FormClosing); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/BrowserSelect/frm_SplashScreen.cs b/BrowserSelect/frm_SplashScreen.cs new file mode 100644 index 0000000..b9063cb --- /dev/null +++ b/BrowserSelect/frm_SplashScreen.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace BrowserSelect +{ + public partial class frm_SplashScreen : Form + { + public frm_SplashScreen() + { + InitializeComponent(); + Icon = Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location); + } + + private void frm_SplashScreen_FormClosing(object sender, System.ComponentModel.CancelEventArgs e) + { + if (!Program.uriExpanderThreadStop) + { + System.Diagnostics.Debug.WriteLine("FormCosing, Abort HTTPWebrequest..."); + Program.uriExpanderThreadStop = true; + Program.webRequestThread.Abort(); + } + e.Cancel = false; + } + } +} diff --git a/BrowserSelect/frm_SplashScreen.resx b/BrowserSelect/frm_SplashScreen.resx new file mode 100644 index 0000000..ec2d462 --- /dev/null +++ b/BrowserSelect/frm_SplashScreen.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + \ No newline at end of file diff --git a/BrowserSelect/frm_settings.Designer.cs b/BrowserSelect/frm_settings.Designer.cs index 9e93958..cb46a56 100644 --- a/BrowserSelect/frm_settings.Designer.cs +++ b/BrowserSelect/frm_settings.Designer.cs @@ -26,10 +26,11 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frm_settings)); this.btn_setdefault = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.browser_filter = new System.Windows.Forms.CheckedListBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.chk_launch_settings = new System.Windows.Forms.CheckBox(); + this.btn_expandurls = new System.Windows.Forms.Button(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.btn_cancel = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); @@ -51,10 +52,10 @@ private void InitializeComponent() { // // btn_setdefault // - this.btn_setdefault.Location = new System.Drawing.Point(6, 87); + this.btn_setdefault.Location = new System.Drawing.Point(6, 47); this.btn_setdefault.Name = "btn_setdefault"; this.btn_setdefault.Size = new System.Drawing.Size(135, 31); - this.btn_setdefault.TabIndex = 0; + this.btn_setdefault.TabIndex = 2; this.btn_setdefault.Text = "Set as Default Browser"; this.btn_setdefault.UseVisualStyleBackColor = true; this.btn_setdefault.Click += new System.EventHandler(this.btn_setdefault_Click); @@ -63,19 +64,9 @@ private void InitializeComponent() { // this.label1.Location = new System.Drawing.Point(6, 16); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(135, 75); + this.label1.Size = new System.Drawing.Size(135, 28); this.label1.TabIndex = 1; - this.label1.Text = "BrowserSelect must be set as default browser for it to function correctly. this b" + - "utton will set it as the default browser."; - // - // label2 - // - this.label2.Location = new System.Drawing.Point(12, 316); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(150, 56); - this.label2.TabIndex = 2; - this.label2.Text = "if you have feature requests,bug reports or suggestions please submit an issue on" + - " the project\'s Github."; + this.label1.Text = "BrowserSelect must be the default browser."; // // groupBox1 // @@ -83,7 +74,7 @@ private void InitializeComponent() { this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(150, 125); - this.groupBox1.TabIndex = 3; + this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "Select Browsers"; // @@ -94,19 +85,42 @@ private void InitializeComponent() { this.browser_filter.Location = new System.Drawing.Point(3, 16); this.browser_filter.Name = "browser_filter"; this.browser_filter.Size = new System.Drawing.Size(144, 106); - this.browser_filter.TabIndex = 0; + this.browser_filter.TabIndex = 1; this.browser_filter.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.browser_filter_ItemCheck); // // groupBox2 // + this.groupBox2.Controls.Add(this.chk_launch_settings); + this.groupBox2.Controls.Add(this.btn_expandurls); this.groupBox2.Controls.Add(this.btn_setdefault); this.groupBox2.Controls.Add(this.label1); this.groupBox2.Location = new System.Drawing.Point(15, 143); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(147, 123); - this.groupBox2.TabIndex = 0; + this.groupBox2.Size = new System.Drawing.Size(147, 157); + this.groupBox2.TabIndex = 1; this.groupBox2.TabStop = false; - this.groupBox2.Text = "Default Browser"; + this.groupBox2.Text = "Options"; + // + // chk_launch_settings + // + this.chk_launch_settings.AutoSize = true; + this.chk_launch_settings.Location = new System.Drawing.Point(9, 122); + this.chk_launch_settings.Name = "chk_launch_settings"; + this.chk_launch_settings.Size = new System.Drawing.Size(131, 30); + this.chk_launch_settings.TabIndex = 4; + this.chk_launch_settings.Text = "launch straight to\r\nsettings when no URL"; + this.chk_launch_settings.UseVisualStyleBackColor = true; + this.chk_launch_settings.CheckedChanged += new System.EventHandler(this.chk_launch_settings_CheckedChanged); + // + // btn_expandurls + // + this.btn_expandurls.Location = new System.Drawing.Point(6, 84); + this.btn_expandurls.Name = "btn_expandurls"; + this.btn_expandurls.Size = new System.Drawing.Size(135, 31); + this.btn_expandurls.TabIndex = 3; + this.btn_expandurls.Text = "URL Expander Config"; + this.btn_expandurls.UseVisualStyleBackColor = true; + this.btn_expandurls.Click += new System.EventHandler(this.btn_expandurls_Click); // // groupBox3 // @@ -121,7 +135,7 @@ private void InitializeComponent() { this.groupBox3.Location = new System.Drawing.Point(168, 12); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(444, 360); - this.groupBox3.TabIndex = 4; + this.groupBox3.TabIndex = 3; this.groupBox3.TabStop = false; this.groupBox3.Text = "Auto Select Filters"; // @@ -151,7 +165,7 @@ private void InitializeComponent() { // linkLabel1 // this.linkLabel1.Dock = System.Windows.Forms.DockStyle.Top; - this.linkLabel1.LinkArea = new System.Windows.Forms.LinkArea(212, 235); + this.linkLabel1.LinkArea = new System.Windows.Forms.LinkArea(247, 17); this.linkLabel1.Location = new System.Drawing.Point(3, 16); this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Size = new System.Drawing.Size(438, 40); @@ -168,7 +182,7 @@ private void InitializeComponent() { this.btn_apply.Location = new System.Drawing.Point(363, 331); this.btn_apply.Name = "btn_apply"; this.btn_apply.Size = new System.Drawing.Size(75, 23); - this.btn_apply.TabIndex = 5; + this.btn_apply.TabIndex = 9; this.btn_apply.Text = "Apply"; this.btn_apply.UseVisualStyleBackColor = true; this.btn_apply.Click += new System.EventHandler(this.btn_apply_Click); @@ -184,8 +198,9 @@ private void InitializeComponent() { this.browser}); this.gv_filters.Location = new System.Drawing.Point(6, 59); this.gv_filters.Name = "gv_filters"; + this.gv_filters.RowHeadersWidth = 30; this.gv_filters.Size = new System.Drawing.Size(432, 266); - this.gv_filters.TabIndex = 1; + this.gv_filters.TabIndex = 6; this.gv_filters.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.gv_filters_CellBeginEdit); this.gv_filters.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.gv_filters_DataError); this.gv_filters.UserAddedRow += new System.Windows.Forms.DataGridViewRowEventHandler(this.gv_filters_CellBeginEdit); @@ -195,7 +210,8 @@ private void InitializeComponent() { // this.pattern.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.pattern.DataPropertyName = "Pattern"; - this.pattern.HeaderText = "Pattern"; + this.pattern.HeaderText = "Domain Pattern"; + this.pattern.MinimumWidth = 10; this.pattern.Name = "pattern"; this.pattern.Resizable = System.Windows.Forms.DataGridViewTriState.False; // @@ -204,6 +220,7 @@ private void InitializeComponent() { this.browser.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.browser.DataPropertyName = "Browser"; this.browser.HeaderText = "Browser"; + this.browser.MinimumWidth = 10; this.browser.Name = "browser"; this.browser.Width = 51; // @@ -211,10 +228,10 @@ private void InitializeComponent() { // this.groupBox4.Controls.Add(this.chk_check_update); this.groupBox4.Controls.Add(this.btn_check_update); - this.groupBox4.Location = new System.Drawing.Point(12, 272); + this.groupBox4.Location = new System.Drawing.Point(12, 331); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(150, 41); - this.groupBox4.TabIndex = 5; + this.groupBox4.TabIndex = 2; this.groupBox4.TabStop = false; this.groupBox4.Text = "Update checker"; // @@ -224,7 +241,7 @@ private void InitializeComponent() { this.chk_check_update.Location = new System.Drawing.Point(12, 16); this.chk_check_update.Name = "chk_check_update"; this.chk_check_update.Size = new System.Drawing.Size(58, 17); - this.chk_check_update.TabIndex = 1; + this.chk_check_update.TabIndex = 4; this.chk_check_update.Text = "enable"; this.chk_check_update.UseVisualStyleBackColor = true; this.chk_check_update.CheckedChanged += new System.EventHandler(this.chk_check_update_CheckedChanged); @@ -234,7 +251,7 @@ private void InitializeComponent() { this.btn_check_update.Location = new System.Drawing.Point(69, 12); this.btn_check_update.Name = "btn_check_update"; this.btn_check_update.Size = new System.Drawing.Size(75, 23); - this.btn_check_update.TabIndex = 0; + this.btn_check_update.TabIndex = 5; this.btn_check_update.Text = "check now"; this.btn_check_update.UseVisualStyleBackColor = true; this.btn_check_update.Click += new System.EventHandler(this.btn_check_update_Click); @@ -244,7 +261,7 @@ private void InitializeComponent() { this.btn_refresh.Location = new System.Drawing.Point(104, 7); this.btn_refresh.Name = "btn_refresh"; this.btn_refresh.Size = new System.Drawing.Size(59, 19); - this.btn_refresh.TabIndex = 2; + this.btn_refresh.TabIndex = 0; this.btn_refresh.Text = "Refresh"; this.btn_refresh.UseVisualStyleBackColor = true; this.btn_refresh.Click += new System.EventHandler(this.btn_refresh_Click); @@ -260,9 +277,8 @@ private void InitializeComponent() { this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); - this.Controls.Add(this.label2); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.MinimumSize = new System.Drawing.Size(358, 414); + this.MinimumSize = new System.Drawing.Size(353, 399); this.Name = "frm_settings"; this.Text = "Settings"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frm_settings_FormClosing); @@ -270,6 +286,7 @@ private void InitializeComponent() { this.Load += new System.EventHandler(this.frm_settings_Load); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); this.groupBox3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gv_filters)).EndInit(); this.groupBox4.ResumeLayout(false); @@ -282,7 +299,6 @@ private void InitializeComponent() { private System.Windows.Forms.Button btn_setdefault; private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.CheckedListBox browser_filter; private System.Windows.Forms.GroupBox groupBox2; @@ -298,5 +314,7 @@ private void InitializeComponent() { private System.Windows.Forms.CheckBox chk_check_update; private System.Windows.Forms.Button btn_check_update; private System.Windows.Forms.Button btn_refresh; + private System.Windows.Forms.Button btn_expandurls; + private System.Windows.Forms.CheckBox chk_launch_settings; } } \ No newline at end of file diff --git a/BrowserSelect/frm_settings.cs b/BrowserSelect/frm_settings.cs index 3161c1c..8653a76 100644 --- a/BrowserSelect/frm_settings.cs +++ b/BrowserSelect/frm_settings.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Drawing; +using System.Linq; using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Forms; @@ -15,10 +16,17 @@ public partial class frm_settings : Form public Form1 mainForm; + public frm_settings() + { + InitializeComponent(); + this.Icon = Icon = Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location); + } + public frm_settings(Form mainForm) { this.mainForm = (Form1)mainForm; InitializeComponent(); + this.Icon = Icon = Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location); } private List rules = new List(); @@ -56,6 +64,12 @@ private void frm_settings_Load(object sender, EventArgs e) gv_filters.DataSource = bs; chk_check_update.Checked = Settings.Default.check_update != "nope"; + chk_launch_settings.Checked = (Boolean)Settings.Default.LaunchToSettings; + + // TODO move this to expand_url form + //cmbo_expand_url.DataSource = (new string[] { "Never", "First Redirect", "All Redirects" }); + //cmbo_expand_url.SelectedItem = Settings.Default.expand_url; + } private void btn_setdefault_Click(object sender, EventArgs e) @@ -202,7 +216,9 @@ private void btn_check_update_Click(object sender, EventArgs e) btn.UseVisualStyleBackColor = true; btn.Enabled = true; } - catch (Exception) { } + catch (Exception ex) { + Debug.WriteLine(ex); + } return x; }, TaskScheduler.FromCurrentSynchronizationContext()); } @@ -226,13 +242,33 @@ private void btn_refresh_Click(object sender, EventArgs e) // add browser select to the list c.Items.Add("display BrowserSelect"); - this.mainForm.updateBrowsers(); + if (mainForm != null) + this.mainForm.updateBrowsers(); + else + browsers = BrowserFinder.find().Where(b => !Settings.Default.HideBrowsers.Contains(b.Identifier)).ToList(); } private void gv_filters_DataError(object sender, DataGridViewDataErrorEventArgs e) { // to prevent System.ArgumentException: DataGridViewComboBoxCell value is not valid MessageBoxes } + + private void cmbo_expand_url_SelectionChangeCommitted(object sender, EventArgs e) + { + Settings.Default.ExpandUrl = (string)((ComboBox)sender).SelectedItem; + Settings.Default.Save(); + } + + private void btn_expandurls_Click(object sender, EventArgs e) + { + (new frm_settings_urlexpander()).ShowDialog(); + } + + private void chk_launch_settings_CheckedChanged(object sender, EventArgs e) + { + Settings.Default.LaunchToSettings = ((CheckBox)sender).Checked; + Settings.Default.Save(); + } } class AutoMatchRule { @@ -270,8 +306,9 @@ public bool valid() { return Browser.Length > 0 && Pattern.Length > 0; } - catch + catch (Exception ex) { + Debug.WriteLine(ex); return false; } diff --git a/BrowserSelect/frm_settings.resx b/BrowserSelect/frm_settings.resx index c6db7be..06c6e32 100644 --- a/BrowserSelect/frm_settings.resx +++ b/BrowserSelect/frm_settings.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Using this section you can add rules that based on them browser select will automatically choose a browser instead of displaying the list for you to choose manually. more information and examples can be found on the project's github. + Using this section you can add rules to enable BrowserSelect to automatically choose a browser instead of displaying the browser list. More information and examples on filters, plus feature requests, bug reports or suggestions can be found on the project's github. diff --git a/BrowserSelect/frm_settings_urlexpander.Designer.cs b/BrowserSelect/frm_settings_urlexpander.Designer.cs new file mode 100644 index 0000000..61dcbfb --- /dev/null +++ b/BrowserSelect/frm_settings_urlexpander.Designer.cs @@ -0,0 +1,181 @@ + +namespace BrowserSelect +{ + partial class frm_settings_urlexpander + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.gv_url_shortners = new System.Windows.Forms.DataGridView(); + this.Domain = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.btn_cancel = new System.Windows.Forms.Button(); + this.btn_ok = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.chk_box_url_expanders = new System.Windows.Forms.CheckedListBox(); + this.cmbo_expand_url = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.gv_url_shortners)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // gv_url_shortners + // + this.gv_url_shortners.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.gv_url_shortners.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gv_url_shortners.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.Domain}); + this.gv_url_shortners.Location = new System.Drawing.Point(6, 19); + this.gv_url_shortners.Name = "gv_url_shortners"; + this.gv_url_shortners.RowHeadersWidth = 30; + this.gv_url_shortners.Size = new System.Drawing.Size(366, 177); + this.gv_url_shortners.TabIndex = 0; + this.gv_url_shortners.EnabledChanged += new System.EventHandler(this.DataGridView_EnabledChanged); + // + // Domain + // + this.Domain.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Domain.DataPropertyName = "Domain"; + this.Domain.HeaderText = "Domain"; + this.Domain.MinimumWidth = 10; + this.Domain.Name = "Domain"; + // + // btn_cancel + // + this.btn_cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn_cancel.Location = new System.Drawing.Point(313, 285); + this.btn_cancel.Name = "btn_cancel"; + this.btn_cancel.Size = new System.Drawing.Size(75, 23); + this.btn_cancel.TabIndex = 3; + this.btn_cancel.Text = "Cancel"; + this.btn_cancel.UseVisualStyleBackColor = true; + this.btn_cancel.Click += new System.EventHandler(this.btn_cancel_Click); + // + // btn_ok + // + this.btn_ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btn_ok.Location = new System.Drawing.Point(232, 285); + this.btn_ok.Name = "btn_ok"; + this.btn_ok.Size = new System.Drawing.Size(75, 23); + this.btn_ok.TabIndex = 2; + this.btn_ok.Text = "&OK"; + this.btn_ok.UseVisualStyleBackColor = true; + this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click); + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.gv_url_shortners); + this.groupBox1.Location = new System.Drawing.Point(10, 10); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(378, 202); + this.groupBox1.TabIndex = 3; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "URL Shortners"; + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.chk_box_url_expanders); + this.groupBox2.Location = new System.Drawing.Point(10, 215); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(378, 64); + this.groupBox2.TabIndex = 4; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Custom URL Processors"; + // + // chk_box_url_expanders + // + this.chk_box_url_expanders.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.chk_box_url_expanders.CheckOnClick = true; + this.chk_box_url_expanders.FormattingEnabled = true; + this.chk_box_url_expanders.Location = new System.Drawing.Point(6, 18); + this.chk_box_url_expanders.Name = "chk_box_url_expanders"; + this.chk_box_url_expanders.Size = new System.Drawing.Size(366, 34); + this.chk_box_url_expanders.TabIndex = 1; + // + // cmbo_expand_url + // + this.cmbo_expand_url.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.cmbo_expand_url.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbo_expand_url.FormattingEnabled = true; + this.cmbo_expand_url.Location = new System.Drawing.Point(92, 286); + this.cmbo_expand_url.Name = "cmbo_expand_url"; + this.cmbo_expand_url.Size = new System.Drawing.Size(130, 21); + this.cmbo_expand_url.TabIndex = 5; + this.cmbo_expand_url.SelectedIndexChanged += new System.EventHandler(this.cmbo_expand_url_SelectedIndexChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(7, 290); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(85, 13); + this.label1.TabIndex = 6; + this.label1.Text = "Expander URLs:"; + // + // frm_settings_urlexpander + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(400, 314); + this.Controls.Add(this.label1); + this.Controls.Add(this.cmbo_expand_url); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.btn_cancel); + this.Controls.Add(this.btn_ok); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Margin = new System.Windows.Forms.Padding(2); + this.Name = "frm_settings_urlexpander"; + this.Text = "URL Expander Config"; + this.Load += new System.EventHandler(this.frm_settings_urlexpander_Load); + ((System.ComponentModel.ISupportInitialize)(this.gv_url_shortners)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.DataGridView gv_url_shortners; + private System.Windows.Forms.DataGridViewTextBoxColumn Domain; + private System.Windows.Forms.Button btn_cancel; + private System.Windows.Forms.Button btn_ok; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckedListBox chk_box_url_expanders; + private System.Windows.Forms.ComboBox cmbo_expand_url; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/BrowserSelect/frm_settings_urlexpander.cs b/BrowserSelect/frm_settings_urlexpander.cs new file mode 100644 index 0000000..6752b83 --- /dev/null +++ b/BrowserSelect/frm_settings_urlexpander.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace BrowserSelect +{ + public partial class frm_settings_urlexpander : Form + { + public frm_settings_urlexpander() + { + InitializeComponent(); + } + + private void frm_settings_urlexpander_Load(object sender, EventArgs e) + { + cmbo_expand_url.DataSource = (new string[] { "Never", "URL shortners", "Follow all redirects" }); + if (Properties.Settings.Default.ExpandUrl == null) + cmbo_expand_url.SelectedItem = "Never"; + else + cmbo_expand_url.SelectedItem = Properties.Settings.Default.ExpandUrl; + gv_url_shortners.Enabled = ((string)cmbo_expand_url.SelectedItem == "URL shortners"); + + if (Properties.Settings.Default.URLShortners != null) + { + foreach (String url in Properties.Settings.Default.URLShortners) + gv_url_shortners.Rows.Add(url); + } + chk_box_url_expanders.DataSource = Program.defaultUriExpander.Select(ele => ele.name).ToList(); + for (int i = 0; i < chk_box_url_expanders.Items.Count; i++) + { + StringCollection url_processors; + if (Properties.Settings.Default.URLProcessors == null) + url_processors = new StringCollection(); + else + url_processors = Properties.Settings.Default.URLProcessors; + chk_box_url_expanders.SetItemChecked(i, url_processors.Contains(chk_box_url_expanders.Items[i].ToString())); + } + } + + private void btn_ok_Click(object sender, EventArgs e) + { + if (Properties.Settings.Default.URLShortners != null) + Properties.Settings.Default.URLShortners.Clear(); + StringCollection url_shortners = new StringCollection(); + foreach (DataGridViewRow row in gv_url_shortners.Rows) + { + if (row.Cells[0].Value != null) + url_shortners.Add(row.Cells[0].Value.ToString()); + } + Properties.Settings.Default.URLShortners = url_shortners; + Properties.Settings.Default.ExpandUrl = (string)((ComboBox)cmbo_expand_url).SelectedItem; + StringCollection url_processors = new StringCollection(); + for (int i = 0; i < chk_box_url_expanders.Items.Count; i++) + { + if (chk_box_url_expanders.GetItemChecked(i)) + url_processors.Add(chk_box_url_expanders.Items[i].ToString()); + } + Properties.Settings.Default.URLProcessors = url_processors; + Properties.Settings.Default.Save(); + Close(); + } + + private void btn_cancel_Click(object sender, EventArgs e) + { + Close(); + } + + private void cmbo_expand_url_SelectedIndexChanged(object sender, EventArgs e) + { + gv_url_shortners.Enabled = ((string)cmbo_expand_url.SelectedItem == "URL shortners"); + } + + private void DataGridView_EnabledChanged(object sender, EventArgs e) + { + DataGridView dgv = sender as DataGridView; + if (!dgv.Enabled) + { + dgv.DefaultCellStyle.BackColor = SystemColors.Control; + dgv.DefaultCellStyle.ForeColor = SystemColors.GrayText; + dgv.ColumnHeadersDefaultCellStyle.BackColor = SystemColors.Control; + dgv.ColumnHeadersDefaultCellStyle.ForeColor = SystemColors.GrayText; + dgv.CurrentCell = null; + dgv.ReadOnly = true; + dgv.EnableHeadersVisualStyles = false; + } + else + { + dgv.DefaultCellStyle.BackColor = SystemColors.Window; + dgv.DefaultCellStyle.ForeColor = SystemColors.ControlText; + dgv.ColumnHeadersDefaultCellStyle.BackColor = SystemColors.Window; + dgv.ColumnHeadersDefaultCellStyle.ForeColor = SystemColors.ControlText; + dgv.ReadOnly = false; + dgv.EnableHeadersVisualStyles = true; + } + } + } +} diff --git a/BrowserSelect/frm_settings_urlexpander.resx b/BrowserSelect/frm_settings_urlexpander.resx new file mode 100644 index 0000000..c67944b --- /dev/null +++ b/BrowserSelect/frm_settings_urlexpander.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + \ No newline at end of file diff --git a/BrowserSelect/packages.config b/BrowserSelect/packages.config index 1df47c7..b25a761 100644 --- a/BrowserSelect/packages.config +++ b/BrowserSelect/packages.config @@ -1,5 +1,6 @@  - - + + + \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index d60c8e5..b31e1e6 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -8,7 +8,7 @@ Properties Tests Tests - v4.0 + v4.7.2 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 @@ -16,6 +16,7 @@ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest + true @@ -25,6 +26,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -33,12 +35,14 @@ TRACE prompt 4 + false 3.5 +