[webkit-help] How to load a file:// image from a webview loaded with a base URL?

Alexander Shulgin alexander.shulgin at yessoftware.com
Fri Jun 25 06:19:35 PDT 2010

On 24.06.2010 22:37, Dan Wood wrote:
> I'm seeing an odd behavior, and I wonder if it is a regression in Safari
> 5's webkit, and if there is a workaround.
> I have an HTML string which I have loaded up from a remote website, and
> modified slightly to include an image with a source of a local file:// URL.
> Then I try to load it into my webview with -[WebFrame
> loadHTMLString:baseURL:]. I pass in the base URL so that the images with
> relative paths will show properly.
> This works fine, except that my file:// image does not load! It's not
> even requested, if I monitor the resource load delegate!

I pretty much believe it is blocked for security reasons, as I ended up 
debugging similar issue just recently.

There's WebCore::SecurityOrigin::addOriginAccessWhitelistEntry() you 
could use, however I can't seem to find it's WebKit equivalent.


More information about the webkit-help mailing list