Created
September 30, 2011 07:20
-
-
Save saitamanodoruji/1252954 to your computer and use it in GitHub Desktop.
pixiv Staccfeed で「お気に入りユーザー追加」ポストのノードを削除
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 staccfeed illusts only | |
// @namespace http://d.hatena.ne.jp/saitamanodoruji/ | |
// @description remove 'added user to favorite' posts | |
// @include http://www.pixiv.net/stacc/* | |
// @version 0.0.1.20110930 | |
// @author saitamanodoruji | |
// ==/UserScript== | |
// | |
// LDRize より後に実行されるとパラグラフと認識されたノードを消しちゃって | |
// うまく j/k できなくなる現象がおきた(1 ページ目だけ)。 | |
// | |
// 次のどちらかで回避 | |
// -実行順を LDRize より前にする | |
// -26 行目をエスケープする(1 ページ目に対する処理を行わない) | |
(function(){ | |
function removeDispensablePosts(node) { | |
var postsToRemove = document.evaluate('.//input[contains(@value,"add_favorite")]/parent::div[contains(concat(" ",normalize-space(@class)," ")," post ")]', node, null, 7, null); | |
for (i = 0; i < postsToRemove.snapshotLength; i++) { | |
var post = postsToRemove.snapshotItem(i); | |
post.parentNode.removeChild(post); | |
} | |
} | |
removeDispensablePosts(document); | |
document.body.addEventListener('AutoPagerize_DOMNodeInserted',function(evt){ | |
var node = evt.target; | |
var requestURL = evt.newValue; | |
var parentNode = evt.relatedNode; | |
removeDispensablePosts(node); | |
}, false); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment