image viewer
by
tamanobi
2014-08-10 [2014/08/10 19:54:10]
画像集めに最適.ウェブページ中に直接リンクされている画像を画面上に表示します.画像をクリックすると,クリックすると戻ります.画面サイズに収まりきらない画像は,ウィンドウサイズにリサイズします.
@@ -1,6 +1,6 @@
/*
* @title image viewer
- * @description ウェブページ中に存在する画像ファイルを表示します.
+ * @description ウェブページ中にリンクされている画像ファイルを表示します.
* @include http://*
* @license MIT License
* @require
/*
* @title image viewer
* @description ウェブページ中にリンクされている画像ファイルを表示します.
* @include http://*
* @license MIT License
* @require
*/
(function(){var an=document.getElementsByTagName("a");var li=new Array();for(var i=0;i<an.length;i++){var el=an[i].getElementsByTagName("img");var ref=an[i].getAttribute("href");var re=new RegExp("(.*)\.(jpg|gif|png)");if((re.test(ref))&&el[0]!=null&&el[0]!=undefined){li.push(ref);}}var liex=li.filter(function(x,i,self){return (self.indexOf(x)===i);});console.log(liex);var main=document.createElement("div");for(var i=0;i<liex.length;i++){var im=document.createElement("img");im.setAttribute("src",liex[i]);main.appendChild(im);}main.style.position="absolute";main.style.left="0";main.style.right="0";main.style.width="100%";(document.getElementsByTagName("body")[0]).appendChild(main)})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。