diff --git a/Core/Notification/FormNotificationBase.cs b/Core/Notification/FormNotificationBase.cs index 86b5c055..67e119a7 100644 --- a/Core/Notification/FormNotificationBase.cs +++ b/Core/Notification/FormNotificationBase.cs @@ -139,8 +139,7 @@ protected FormNotificationBase(FormBrowser owner, bool enableContextMenu){ DpiScale = this.GetDPIScale(); - DefaultResourceHandlerFactory handlerFactory = (DefaultResourceHandlerFactory)browser.ResourceHandlerFactory; - handlerFactory.RegisterHandler(TwitterUtils.TweetDeckURL, this.resourceHandler); + browser.GetHandlerFactory().RegisterHandler(TwitterUtils.TweetDeckURL, this.resourceHandler); Controls.Add(browser); diff --git a/Core/Utils/BrowserUtils.cs b/Core/Utils/BrowserUtils.cs index 7109ce36..90789a68 100644 --- a/Core/Utils/BrowserUtils.cs +++ b/Core/Utils/BrowserUtils.cs @@ -35,6 +35,10 @@ public static ChromiumWebBrowser AsControl(this IWebBrowser browserControl){ return (ChromiumWebBrowser)browserControl; } + public static DefaultResourceHandlerFactory GetHandlerFactory(this ChromiumWebBrowser browser){ + return (DefaultResourceHandlerFactory)browser.ResourceHandlerFactory; + } + private const string TwitterTrackingUrl = "t.co"; public enum UrlCheckResult{