[webkit-help] download window

Nayan nayankk at gmail.com
Sun Nov 8 23:10:00 PST 2009

Hi Benoit,

Frameloader has the following API which can be used to check if the URL can
be displayed in webview.

'bool canShowMIMEType(const String& MIMEType) const;'

In GTK port, wrapper to this method, which is exposed is

gboolean webkit_web_view_can_show_mime_type(WebKitWebView* webView, const
gchar* mimeType)

In order to show 'Download window' in GTK port, you could do the following,
a. Connect to 'mime-type-policy-decision-requested'
b. In signal handler of above signal, call
'webkit_web_view_can_show_mime_type' to check if mime type can be displayed
by webview.
c. Call 'webkit_web_policy_decision_download()', if webview cannot display
the content, which will trigger the download.

There should be equivalent of above API's in other ports as well to trigger

You can find the example at 'WebKit/gtk/tests/testdownload.c'

On Mon, Nov 9, 2009 at 12:18 PM, Benoit Chesneau <bchesneau at gmail.com>wrote:

> Hi,
> How could I display a "download window" when content behind a link
> can't displayed in the webview ? There is a hook for for upload input
> but I didn't see any hook for this.  I sthere a way to know the url
> can't be displayed ?
> - benoiît
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20091109/8f01ad25/attachment-0001.html>

More information about the webkit-help mailing list