mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-05 20:34:07 +02:00
parent
72973a8707
commit
f7961024d7
@ -4,11 +4,15 @@
|
||||
|
||||
namespace TweetDuck.Core.Handling.General{
|
||||
sealed class LifeSpanHandler : ILifeSpanHandler{
|
||||
private static bool IsPopupAllowed(string url){
|
||||
return url.StartsWith("https://twitter.com/teams/authorize?");
|
||||
}
|
||||
|
||||
public static bool HandleLinkClick(IWebBrowser browserControl, WindowOpenDisposition targetDisposition, string targetUrl){
|
||||
switch(targetDisposition){
|
||||
case WindowOpenDisposition.NewBackgroundTab:
|
||||
case WindowOpenDisposition.NewForegroundTab:
|
||||
case WindowOpenDisposition.NewPopup:
|
||||
case WindowOpenDisposition.NewPopup when !IsPopupAllowed(targetUrl):
|
||||
case WindowOpenDisposition.NewWindow:
|
||||
browserControl.AsControl().InvokeAsyncSafe(() => BrowserUtils.OpenExternalBrowser(targetUrl));
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user