How to grab images from other page in background using only JS?

xixxon

New Member
I'm making a Chrome extension and am wanting to load a page in the background and grab images from it. I know that I could do this using jQuery's \[code\]$.get()\[/code\] function followed by several \[code\]indexOf()\[/code\] statements nested within a loop, something like:\[code\] $.get("http://...", function(response) { a=response.indexOf("<IMG ", a)+1; while (a>0) { ...\[/code\]but I'm wondering if there's an easier way, maybe loading the page in an invisible iframe with the background script and looping through all the IMG objects in it? I've never done that before so any pointers would be welcome.
 
Top