views:

800

answers:

4

I'm doing an iPhone version of a desktop site that includes a blog. The blog often embeds images from other domains (the image URLs always start with http:// in this case, obviously), but because I'm using cache-manifest, these images don't load because they aren't declared in the manifest file.

I have a NETWORK: whitelist section that has all of my AJAX request files, etc. I've even whitelisted the flickr farm domains because a lot of the images we add to the blog come from our flickr page. The flickr images show up just fine, but any other "random" image hotlinks from another domain show broken.

I tried adding a line like this:

http://

to the NETWORK: section, but it doesn't seem to like http:// as a whitelist.

Does anyone have any thoughts on this?

Thanks! Alex

+2  A: 

just add the "online whitelist wildcard flag" to your manifest:

NETWORK:
*

that should do the trick! more info on the whatwg spec page

hope this helps!

futtta
That doesn't work on iPhone Safari but did seem to fix the problem on the desktop...apparently the iPhone implementation of the cache manifest isn't quite to spec.
Alex Ford
A: 

I am having the same problem with pictures possibly coming from lots of differents places. I found the NETWORK:* way but it is not working on safari mobile, safari desktop and firefox.

Can we turn the flag to open another way (javascript perhaps) ?

Greg
+1  A: 

I think I've got a workaround. What if you created a simple server-side file (remoteResource.php) that you could reference like this:

remoteResource.php?resource=http://somewhere.com/remote/image.jpg

The PHP (or whatever server side language you're using) could just cURL in the remote resource and send it unmodified to the browser. Then, whitelist that file.

I haven't tested this because the environment I'm working with doesn't have cURL installed (ugh) but I don't see why it can't work.

Alex Ford
Now that I think of this again, it would require some kind of parsing (JavaScript, probably) to add the "remoteResource.php?resource=" to the start of the relevant "src" attributes. Shouldn't be too difficut, though.
Alex Ford
A: 

Hi ! I have the same problem with external images Does anybody solve it ?

Max