[webkit-gtk] Getting an element which sent a resource request

Dan Vratil dvratil at redhat.com
Tue Jan 10 08:47:28 PST 2012


I'd like to decide upon every image being requested whether to actually load 
it or not. I tried using mime-type-policy-decision-requested signal, but it 
seems to be emitted only for web frames, not for each resource.

Using resource-request-starting does not work either because there I can't 
really see whether the request is related to an document, image, stylesheet or 
something else (I tried traversing the DOM tree for every resource request 
looking for <IMG> tags and comparing "src" with the URI to determine whether 
an image is being requested, but the <img> tags are not present in the DOM 
tree in this early stage).

Is there any other way where I could get information about whether the request 
is related to an image element and also stop/redirect the request when I 
decide I don't want that particular image loaded? Ideally I'd like to do this 
without actually downloading the image, since the main purpose of this is to 
to save bandwidth.

Thanks for any suggestion


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20120110/dd194dd0/attachment.bin>

More information about the webkit-gtk mailing list