booc0mtaco/image-sourcer

Pull in code from Bookmarklet

Closed this issue · 0 comments

The bookmarklet will open a new tab with square versions of the images on a page. They are linked so that when you click them, they will open the source image in a new page. Pull this into the format of a plugin for chrome.

Here's the ugly version:

javascript:(function()%7Bvar%20imgs%20=%20document.getElementsByTagName('img'),t=%5B%5D;for%20(var%20i=0,%20n=imgs.length;i%3Cn;i++)%7Bt.push('%3Ca%20href=%5C''+imgs%5Bi%5D.src+'%5C'%3E%3Cimg%20src=%5C''+imgs%5Bi%5D.src+'%5C'%20width=100%3E%3C/a%3E');%7Dif%20(t.length)%20%7B%20var%20w=window.open('','_blank');%20if%20(w)%20%7Bw.document.write(t.join('%C2%A0'));w.document.close();%7Delse%7Balert('cannot%20pop%20a%20window');%7D%7D%7D)();