[webkit-gtk] Getting an element which sent a resource request
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...
Size: 490 bytes
Desc: This is a digitally signed message part.
More information about the webkit-gtk