[webkit-gtk] how to download

Deepak Mundra deepak.m at allaboutif.com
Fri May 21 06:08:36 PDT 2010


Please reply to all (mailing list) so that it will help other people
also in the list.

You can try adding following signals to your main webview

g_signal_connect (web_view, "mime-type-policy-decision-requested",
G_CALLBACK (mime_type_decision_cb), web_view);
g_signal_connect (web_view, "download-requested", G_CALLBACK
(download_request_cb), NULL);

in download_request_cb callback function add filechooser etc... and in
mime_type_decision_cb callback function  add code something like

if (webkit_web_view_can_show_mime_type (WEBKIT_WEB_VIEW (web_view),
        return FALSE;

webkit_web_policy_decision_download (decision);
webkit_web_view_stop_loading (WEBKIT_WEB_VIEW (web_view));

return TRUE;

this will send download-requested signal if web view cannot handle that MIME,

On Fri, May 21, 2010 at 2:53 PM, EBerry-EdBook <aagarwal at eberry.in> wrote:
> thank you  sir it is working .
> now I am facing one more problem, How i get to know on which url i have
> to apply  download  policy
> (webkit_web_policy_decision_download(decision);)
> Is there any inbuilt function for that or i have to write a code for
> that.
>  Regards
> Avichal
> On Fri, 2010-05-21 at 10:57 +0530, Deepak Mundra wrote:
>> WebKit/gtk/tests/testdownload.c

More information about the webkit-gtk mailing list