[webkit-dev] Blocking resource loading

Frank Thomsen fth at trifork.com
Fri Feb 20 06:27:12 PST 2009


Let's say that I want my WebKit-enabled app to load pages from a specific domain. I implemented a IWebPolicyDelegate delegate and set it on the webview by calling setPolicyDelegate . The policy delegate filters page load requests in the decidePolicyForNavigationAction method and all is well.
But I also want to block resources (say, pictures) that does not originate from my specified domain, in case someone manages to alter the content on the web server. I tried to implement a IwebResourceLoadDelegate and set it on the webview by calling setResourceLoadDelegate. I implemented the method willSendRequest and figured that I could block the loading of a resource by return E_FAIL (or something else other than S_OK) but it doesn't work.

So please, what am I missing here?

Best regards
Frank Thomsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090220/04588bae/attachment.html>

More information about the webkit-dev mailing list