yhejazi2016 / open-webkit-sharp

Automatically exported from code.google.com/p/open-webkit-sharp
0 stars 0 forks source link

Cannot cancel navigation programmatically #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a project with the WebKitBrowser component
2. Wire in the Navigating Event
3. Add e.Cancel to the Navigating Method, e.g.

private void webKitBrowser1_Navigating(object sender, 
WebBrowserNavigatingEventArgs e)
    {
        e.Cancel=true;
    }
4. Run the application and navigate around. All pages etc. navigate without 
issue

What is the expected output? What do you see instead?
e.Cancel should stop the request from being processed ultimately cancelling the 
navigation.

What version of the product are you using? On what operating system?
1.7

Please provide any additional information below.
This feature is very important to us to allow us for filtering etc. I

Original issue reported on code.google.com by ajgo...@gmail.com on 28 Oct 2011 at 5:38

GoogleCodeExporter commented 8 years ago
Thanks for the info. Actually, you can do what you want to do by using: (sender 
as WebKitBrowser).Stop(); to stop navigation until I fix this problem. 

Thanks for this detailed issue report.

Original comment by tsumalis96@gmail.com on 28 Oct 2011 at 11:51

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hi, thanks for the quick response. (sender as WebKitBrowser).Stop(); throws an 
error in WebKitBrowser.cs on:
 StatusTextChanged(this, new WebKitBrowserStatusChangedEventArgs("Connecting with " + new Uri(frame.provisionalDataSource().request().url()).Host));

The error is:
COMException was unhandled by user code
  {"Error HRESULT E_FAIL has been returned from a call to a COM component."}
   at WebKit.Interop.IWebFrame.provisionalDataSource()
   at WebKit.WebKitBrowser.frameLoadDelegate_DidStartProvisionalLoadForFrame(WebView WebView, IWebFrame frame) in C:\OpenWebKitSharp\OpenWebKitSharp\WebKitBrowser.cs:line 1330
   at WebKit.DidStartProvisionalLoadForFrameEvent.Invoke(WebView WebView, IWebFrame frame)
   at WebKit.WebFrameLoadDelegate.didStartProvisionalLoadForFrame(WebView WebView, IWebFrame frame) in C:\OpenWebKitSharp\OpenWebKitSharp\WebFrameLoadDelegate.cs:line 121

Original comment by ajgo...@gmail.com on 28 Oct 2011 at 12:10

GoogleCodeExporter commented 8 years ago
It seems to be a webkit error which occurs after a call to the COM object 
IWebFrame. The frameLoadDelegate_DidStartProvisionalLoadForFrame seems to be 
called after the Stop method is called and probably the IWebFrame object is 
faulty. I will try to investigate this issue further and will inform you for 
any update. Thanks for your interest with OWS!

Original comment by tsumalis96@gmail.com on 28 Oct 2011 at 6:43

GoogleCodeExporter commented 8 years ago
It has been implemented in the latest version.

Original comment by tsumalis96@gmail.com on 24 Nov 2011 at 5:50