Skip to content

Instantly share code, notes, and snippets.

@libraplanet
Last active April 17, 2017 15:55
Show Gist options
  • Save libraplanet/217013b4ed002028bda988c7bec52252 to your computer and use it in GitHub Desktop.
Save libraplanet/217013b4ed002028bda988c7bec52252 to your computer and use it in GitHub Desktop.
nocomment niconico using tampermonkey.
// ==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