Public Class BrowserLifeSpanHandler
Implements ILifeSpanHandler
Private ChromeBrowser_popup As ChromiumWebBrowser
Public Function
OnBeforePopup(browserControl As IWebBrowser, browser As IBrowser, frame As IFrame, targetUrl As String, targetFrameName As String, targetDisposition As
WindowOpenDisposition, userGesture As Boolean, popupFeatures As IPopupFeatures,
windowInfo As IWindowInfo,
browserSettings As IBrowserSettings, ByRef noJavascriptAccess As Boolean, ByRef newBrowser As IWebBrowser) As Boolean Implements ILifeSpanHandler.OnBeforePopup
'Dim
urlDecoded As String = System.Web.HttpUtility.UrlDecode(targetUrl)
'Process.Start(urlDecoded)
' --> abrir url en navegador predetrminado
'Dim
newPopUp As New form1 ' --> abrir url en form y pasar la url al navegador
del form
'newPopUp.Show()
'newPopUp.NavigateTo(targetUrl)
Return False ' --> False: abre
emergente | True: bloquea
End Function
Public Sub
OnAfterCreated(browserControl As IWebBrowser, browser As IBrowser) Implements ILifeSpanHandler.OnAfterCreated
End Sub
Public Function
DoClose(browserControl As IWebBrowser, browser As IBrowser) As Boolean Implements ILifeSpanHandler.DoClose
End Function
Public Sub
OnBeforeClose(browserControl As IWebBrowser, browser As IBrowser) Implements ILifeSpanHandler.OnBeforeClose
End Sub
End Class
Dim life As New BrowserLifeSpanHandler()
ChromeBrowser.LifeSpanHandler = life