-
Notifications
You must be signed in to change notification settings - Fork 0
/
LifeSpanHandler.cs
30 lines (24 loc) · 1.03 KB
/
LifeSpanHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using CefSharp;
namespace BlocklyMirai
{
public class LifeSpanHandler : ILifeSpanHandler
{
public bool DoClose(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
return true;
}
public void OnAfterCreated(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
}
public void OnBeforeClose(IWebBrowser chromiumWebBrowser, IBrowser browser)
{
}
public bool OnBeforePopup(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser)
{
if(targetUrl.ToLower().StartsWith("http://") || targetUrl.ToLower().StartsWith("https://")) System.Diagnostics.Process.Start(targetUrl);
newBrowser = null;
return true;
}
}
}