Last active
November 26, 2016 13:25
-
-
Save takuya-murao/5898691 to your computer and use it in GitHub Desktop.
ニコニコ大百科の掲示板の削除されたレスを非表示にします
This file contains 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 Hide deleted posts in Nicodic BBS | |
// @namespace https://twitter.com/takuya_murao | |
// @include http://dic.nicovideo.jp/a/* | |
// @include http://dic.nicovideo.jp/l/* | |
// @include http://dic.nicovideo.jp/v/* | |
// @include http://dic.nicovideo.jp/b/a/* | |
// @include http://dic.nicovideo.jp/b/l/* | |
// @include http://dic.nicovideo.jp/b/v/* | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
var nicodic_bbs = function(node) { | |
var i; | |
var deleted_dt_text = /\uFF1A\u524A\u9664\u3057\u307E\u3057\u305F\s+ID: .{10}/; | |
var dts = node.getElementsByTagName('dt'); | |
var dds = node.getElementsByTagName('dd'); | |
var len = dts.length; | |
for (i = 0; i < len; i++) { | |
if (deleted_dt_text.test(dts[i].innerText)) { | |
dts[i].hidden = true; | |
dds[i].hidden = true; | |
} | |
} | |
}; | |
var extend = function(evt) { | |
var node = evt.target; | |
var requestURL = evt.newValue; | |
var parentNode = evt.relatedNode; | |
nicodic_bbs(node); | |
}; | |
nicodic_bbs(document.body); | |
document.body.addEventListener('AutoPagerize_DOMNodeInserted', extend, false); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment