Saving images from webview

You must Login before you can answer or comment on any questions.

Hi, I'm trying to save images which are loaded and rendered in a webview. The way I get this done is by gathering all urls of the images in the webview javascript context and send them as a list to an event listener attached on Ti.App. Then I load them one by one (again..) with a XHR object to get them written to files (responseData) on the device.... my question is, can this be done easier? Maybe there is some cache or temp place where I could retrieve the images from?

3 Answers

In the current implementation, only custom events can pass back and forth between web views, so you couldn't directly write those files. It might be worth backing up a bit to see if there's a way your native code could simply go out and fetch those images. Maybe you could do an XHR request for the page's HTML and parse that in native code?

true, but the images should be available in some sort of cache folder.... but I guess pre parsing is my best option

true, but the images should be available in some sort of cache folder.... but I guess pre parsing is my best option

Your Answer

Think you can help? Login to answer this question!