[webkit-dev] How to cancel a resource request

Xan Lopez xan at gnome.org
Fri Oct 23 06:29:32 PDT 2009

On Thu, Oct 22, 2009 at 11:18 AM, Jaroslav Gresula
<jgresula.LEAVE-THIS-OUT at gmail.com> wrote:
> Hi,
> In my WebKit port (based on the GTK port) I would like to cancel a
> resource request depending on the resource length or its MIME type.
> I thought, dispatchDidReceiveResponse(DocumentLoader*, ...) in my
> WebCore::FrameLoaderClient implementation could be a good place for such
> action as I can retrieve the length and the MIME type from the
> ResourceResponse argument there. However I did not find the way how to
> cancel the request.
> Any help would be appreciated.

in dispatchWillSendRequest you can modify the URI of the resource
that's about to be requested. If you set it to, say, "about:blank",
nothing will be requested. This is what the GTK+ port does, through a
signal emission, to let clients implement things like adblock.


> Thanks,
> --
> Jarda
> http://jagpdf.org
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

More information about the webkit-dev mailing list