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) { BrowserMain newTab = null; _tab.ParentTabs.Invoke(new Action(() => { _tab.ParentTabs.AddNewTab(); newTab = _tab.ParentTabs.SelectedTab.Content as BrowserMain; bool newTabLoaded = false; if (!newTab.WebBrowser.IsBrowserInitialized) { newTab.WebBrowser.IsBrowserInitializedChanged += (_, __) => { newTab.WebBrowser.LoadingStateChanged += (___, e) => { if (!newTabLoaded) { if (!e.IsLoading) { newTabLoaded = true; newTab.WebBrowser.Load(targetUrl); } } }; }; } else { newTab.WebBrowser.LoadingStateChanged += (_, e) => { if (!newTabLoaded) { if (!e.IsLoading) { newTabLoaded = true; newTab.WebBrowser.Load(targetUrl); } } }; } })); newBrowser = null; return(true); }
public ContextMenuHandler(BrowserMain form) { myForm = form; }
public NewTabLifespanHandler(BrowserMain tab) { _tab = tab; }