private void frameLoadDelegate_DidStartProvisionalLoadForFrame(WebView WebView, IWebFrame frame) { if (frame == webView.mainFrame()) { string url = frame.provisionalDataSource().request().url(); if (!string.IsNullOrEmpty(url)) { BackgroundWorker bw = new BackgroundWorker(); bw.RunWorkerCompleted += delegate (object s, RunWorkerCompletedEventArgs e) { if (e.Result != null && e.Result.GetType().Equals(typeof(WebException))) { HTTPErrorOccured(this, new HTTPErrorEventArgs() { WebException = (WebException)e.Result }); }}; bw.DoWork += new DoWorkEventHandler(bw_DoWork); HeadersAvailableEventArgs h = new HeadersAvailableEventArgs(new Uri(frame.provisionalDataSource().request().url()), frame.provisionalDataSource().request()); bw.RunWorkerAsync(h); string Url = h.Url.ToString(); if (resourceIntercepter != null) resourceIntercepter.Resources.Clear(); WebKitBrowserNavigatingEventArgs args = new WebKitBrowserNavigatingEventArgs(new Uri(url), frame.name(), tempmimetype); Navigating(this, args); if (args.Cancel == true) { frame.stopLoading(); } else { try { StatusTextChanged(this, new WebKitBrowserStatusChangedEventArgs(string.Format(LanguageLoader.ConnectingWith, new Uri(frame.provisionalDataSource().request().url()).Host))); _status = string.Format(LanguageLoader.ConnectingWith, new Uri(frame.provisionalDataSource().request().url()).Host); } catch { } } } } }
void Owner_Navigating(object sender, WebKitBrowserNavigatingEventArgs e) { UndoDeedsN.Clear(); UndoDeedsI.Clear(); }
void webKitBrowser1_Navigating(object sender, WebKitBrowserNavigatingEventArgs e) { // here you can interfere with the WebKitBrowser object before it attempts to load a web page // You can cancel the navigation progress and get the Url and TargetFrameName }
private void webKitBrowser1_Navigating(object sender, WebKitBrowserNavigatingEventArgs e) { urlBar.Text = e.Url.ToString(); }