Created
September 4, 2011 20:58
-
-
Save k-hamada/1193500 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Pixiv Autopagerize Added Thumbnail Patch | |
// @author k.hamada <[email protected]> http://about.me/k.hamada | |
// @description AutoPagerizeで継ぎ足したPixivのサムネイルが、検索2ページ目以降でも表示されるようにするパッチ | |
// @version 1.3 | |
// @updateURL https://raw.github.com/gist/1193500?.user.js | |
// @include /^https?:\/\/(?:www\.)?pixiv\.net\/(search|tags|new_illust|member_illust|bookmark|bookmark_new_illust|mypixiv_new_illust)\.php/i | |
// @run-at document-end | |
// ==/UserScript== | |
// via. [AutoPagerize_DOMNodeInserted 使用時のテンプレート - twwp](http://d.hatena.ne.jp/taizooo/20101105/1288920138) | |
// via. [イラスト・マンガの投稿コミュニティpixiv part147](http://hibari.2ch.net/test/read.cgi/cg/1314635086/258) | |
(function(){ | |
var main = function (node) { | |
var imgs = node.getElementsByTagName("img"); | |
for (var i = 0, l = imgs.length; i < l; i++) { | |
var img = imgs[i], | |
src = img.getAttribute("data-src"); | |
if (src) { | |
var e = document.createElement("img"); | |
e.setAttribute("src", src); | |
img.parentNode.replaceChild(e, img); | |
}; | |
}; | |
}; | |
var addFilterHandler = function (evt) { | |
main(evt.target); | |
}; | |
document.body.addEventListener("AutoPagerize_DOMNodeInserted", addFilterHandler, false); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment