private void _OnFirstNavigated(object sender, System.Windows.Navigation.NavigationEventArgs e) { Browser.Navigated -= _OnFirstNavigated; Assert.IsNotNull(Browser.Document); Utility.SuppressJavaScriptErrors(Browser); _eventHook = new WebBrowserEvents(Browser); _eventHook.WindowClosing += (sender2, e2) => Close(); }
private void _HookNativeBrowserWindow() { if (!_hasHookedIWebBrowser) { Assert.IsNotNull(_browser.Document); Utility.SuppressJavaScriptErrors(_browser); _browserEvents = new WebBrowserEvents(_browser); _browserEvents.WindowClosing += _OnBrowserWindowClosing; _hasHookedIWebBrowser = true; } }
public TridentWebBrowser ( IHtmlDocumentHandleRegistry documentHandleRegistry, ISubscriptionProvider subscriptionProvider, IUrlFilter nonApplicationUrlFilter, IUrlFilter entryPointFilter, IUrlFilter applicationUrlFilter) { ArgumentUtility.CheckNotNull ("documentHandleRegistry", documentHandleRegistry); ArgumentUtility.CheckNotNull ("subscriptionProvider", subscriptionProvider); ArgumentUtility.CheckNotNull ("nonApplicationUrlFilter", nonApplicationUrlFilter); ArgumentUtility.CheckNotNull ("entryPointFilter", entryPointFilter); ArgumentUtility.CheckNotNull ("applicationUrlFilter", applicationUrlFilter); BrowserEvents = new WebBrowserEvents (this, nonApplicationUrlFilter, applicationUrlFilter, entryPointFilter); Navigate (c_blankSite); // bootstrap _documentHandleRegistry = documentHandleRegistry; _subscriptionProvider = subscriptionProvider; _applicationUrlFiler = applicationUrlFilter; InstallCustomUIHandler (new DocumentHostUIHandler (this)); DocumentCompleted += OnDocumentCompleted; _documentHandleRegistry.DocumentRegistered += OnDocumentRegistered; }