Question

I'm importing the method in C# mono (since dom_document isn't implemented in webkit-sharp), like this:

class ExtendedWebView : WebKit.WebView {
    [DllImport ("webkit-1.0")]
    private static extern IntPtr webkit_web_view_get_dom_document (IntPtr raw);

    public DOMDocument get_dom_document()
    {
        return new DOMDocument(webkit_web_view_get_dom_document(base.Handle));
    }
}

base.Handle is an IntPtr to the WebView object. The webkit_web_view_get_dom_document never returns. I'm calling this in a separate thread. The thread just hangs indefinitely.

I also tried isolating the method call, to be sure that was what was hanging. I passed in an IntPtr and assigned the return value to an IntPtr. It's definitely webkit_web_view_get_dom_document that isn't returning.

Anybody know why this is happening? Maybe I'm using the wrong version of webkit? Does that method not exist?

Était-ce utile?

La solution

Webkit 1.0 doesn't include the DOMDocument stuff. I ended up having to use a newer version of webkit-sharp (which hasn't actually been released yet) which already has the DOMDocument implementation.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top