您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
ニコニコ動画のコメントをデフォルトで非表示にするスクリプトです
// ==UserScript== // @name ニコニコ動画 コメント非表示 // @namespace ncode // @match https://www.nicovideo.jp/watch/* // @version 14 // @description ニコニコ動画のコメントをデフォルトで非表示にするスクリプトです // @grant none // ==/UserScript== let comment_close_timer; let check_comment_close = function(){ let comment_close_count = 0; comment_close_timer = setInterval(function(){ comment_close_count++; if (comment_close_count > 6) { clearInterval(comment_close_timer); } try { let buttons = document.getElementsByClassName('cursor_pointer'); for(let i = 0;buttons.length;i++) { if (buttons[i].getAttribute('aria-label') == 'コメントを非表示にする') { buttons[i].click(); break; } else if (buttons[i].getAttribute('aria-label') == 'コメントを表示する') { break; } } } catch(e) { } }, 500); } check_comment_close(); let comment_close_href = location.href; let comment_close_observer = new MutationObserver(function(mutations) { if(comment_close_href !== location.href) { comment_close_href = location.href; if (comment_close_timer) { clearInterval(comment_close_timer); } check_comment_close(); } }); comment_close_observer.observe(document, { childList: true, subtree: true });