diff --git a/Configuration/UserConfig.cs b/Configuration/UserConfig.cs index c3187de4..0a5872ea 100644 --- a/Configuration/UserConfig.cs +++ b/Configuration/UserConfig.cs @@ -51,9 +51,10 @@ static UserConfig(){ public bool BestImageQuality { get; set; } = true; public bool EnableAnimatedImages { get; set; } = true; - public bool EnableSmoothScrolling { get; set; } = true; - public string BrowserPath { get; set; } = null; - private int _zoomLevel = 100; + public bool IgnoreTrackingUrlWarning { get; set; } = false; + public bool EnableSmoothScrolling { get; set; } = true; + public string BrowserPath { get; set; } = null; + private int _zoomLevel = 100; private bool _muteNotifications; public int VideoPlayerVolume { get; set; } = 50; diff --git a/Core/Utils/BrowserUtils.cs b/Core/Utils/BrowserUtils.cs index 44c3ca44..d2e2657c 100644 --- a/Core/Utils/BrowserUtils.cs +++ b/Core/Utils/BrowserUtils.cs @@ -93,10 +93,27 @@ public static void OpenExternalBrowser(string url){ break; case UrlCheckResult.Tracking: - if (FormMessage.Warning("Blocked URL", "TweetDuck has blocked a tracking url due to privacy concerns. Do you want to visit it anyway?\n"+url, FormMessage.Yes, FormMessage.No)){ + if (Program.UserConfig.IgnoreTrackingUrlWarning){ goto case UrlCheckResult.Fine; } + using(FormMessage form = new FormMessage("Blocked URL", "TweetDuck has blocked a tracking url due to privacy concerns. Do you want to visit it anyway?\n"+url, MessageBoxIcon.Warning)){ + form.AddButton(FormMessage.No, DialogResult.No, ControlType.Cancel | ControlType.Focused); + form.AddButton(FormMessage.Yes, DialogResult.Yes, ControlType.Accept); + form.AddButton("Always Visit", DialogResult.Ignore); + + DialogResult result = form.ShowDialog(); + + if (result == DialogResult.Ignore){ + Program.UserConfig.IgnoreTrackingUrlWarning = true; + Program.UserConfig.Save(); + } + + if (result == DialogResult.Ignore || result == DialogResult.Yes){ + goto case UrlCheckResult.Fine; + } + } + break; case UrlCheckResult.Invalid: