mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-30 02:53:11 +02:00
Configuration
Core
Bridge
Controls
Handling
BrowserProcessHandler.cs
ContextMenuBase.cs
ContextMenuBrowser.cs
ContextMenuNotification.cs
JavaScriptDialogHandler.cs
LifeSpanHandler.cs
RequestHandler.cs
RequestHandlerBrowser.cs
ResourceHandlerNotification.cs
Notification
Other
Utils
FormBrowser.Designer.cs
FormBrowser.cs
FormBrowser.resx
TrayIcon.Designer.cs
TrayIcon.cs
Plugins
Properties
Resources
Updates
bld
lib
subprocess
tests
.gitignore
LICENSE.md
Program.cs
README.md
Reporter.cs
TweetDuck.csproj
TweetDuck.sln
TweetDuck.sln.DotSettings
_postbuild.bat
packages.config
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
using CefSharp;
|
|
using TweetDuck.Core.Utils;
|
|
|
|
namespace TweetDuck.Core.Handling{
|
|
class LifeSpanHandler : ILifeSpanHandler{
|
|
public bool OnBeforePopup(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser){
|
|
newBrowser = null;
|
|
|
|
switch(targetDisposition){
|
|
case WindowOpenDisposition.NewBackgroundTab:
|
|
case WindowOpenDisposition.NewForegroundTab:
|
|
case WindowOpenDisposition.NewPopup:
|
|
case WindowOpenDisposition.NewWindow:
|
|
BrowserUtils.OpenExternalBrowser(targetUrl);
|
|
return true;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public void OnAfterCreated(IWebBrowser browserControl, IBrowser browser){}
|
|
|
|
public bool DoClose(IWebBrowser browserControl, IBrowser browser){
|
|
return false;
|
|
}
|
|
|
|
public void OnBeforeClose(IWebBrowser browserControl, IBrowser browser){}
|
|
}
|
|
}
|