[webkit-dev] Blocking resource loading
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev