Пример #1
0
        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 { }
                    }
                }
            } 
         
        }
Пример #2
0
 void Owner_Navigating(object sender, WebKitBrowserNavigatingEventArgs e)
 {
     UndoDeedsN.Clear();
     UndoDeedsI.Clear();
 }
Пример #3
0
 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
 }
Пример #4
0
 void Owner_Navigating(object sender, WebKitBrowserNavigatingEventArgs e)
 {
     UndoDeedsN.Clear();
     UndoDeedsI.Clear();
 }
Пример #5
0
 private void webKitBrowser1_Navigating(object sender, WebKitBrowserNavigatingEventArgs e)
 {
     urlBar.Text = e.Url.ToString();
 }