Last active
April 17, 2017 15:55
-
-
Save libraplanet/217013b4ed002028bda988c7bec52252 to your computer and use it in GitHub Desktop.
nocomment niconico using tampermonkey.
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 nocomment niconico. | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author takumi | |
// @match http://www.nicovideo.jp/watch/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Your code here... | |
var buttonClick = function(btn) { | |
if(btn){ | |
if(btn.onclick){ | |
btn.onclick(); | |
//alert('onclick()'); | |
} else if(btn.click){ | |
btn.click(); | |
//alert('click()'); | |
} else { | |
//alert('n/a'); | |
} | |
} else { | |
//alert('n/a'); | |
} | |
}; | |
var proc = function() { | |
var iconHide = document.querySelectorAll('.PlayerContainer > .TogglePattern > .ControllerBoxContainer > .ControllerContainer > .ControllerContainer-inner > .ControllerContainer-area > .CommentOnOffButton > .CommentOnOffButton-iconHide'); | |
//alert(iconHide + ", length:" + iconHide.length); | |
if(iconHide) { | |
for(var i = 0; i < iconHide.length; i++) { | |
var svg = iconHide[i]; | |
var button = svg.parentElement; | |
buttonClick(button); | |
} | |
} | |
}; | |
proc(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment