您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
かんたんコメント率を表示
// ==UserScript== // @name 簡易コメ率 // @namespace tanbatsu // @version 0.1 // @author You // @grant unsafeWindow // @description かんたんコメント率を表示 // @license MIT // @match https://www.nicovideo.jp/watch/sm* // @icon https://www.google.com/s2/favicons?sz=64&domain=nicovideo.jp // @grant none // ==/UserScript== (() => { const isTarget = response => response.url.startsWith("https://nvcomment.nicovideo.jp/v1/threads"); const changeJson = json => { console.log(json.data.threads[2].commentCount) document.getElementsByClassName("FormattedNumber")[1].innerHTML+="<small>(簡易コメ率:"+Math.floor(json.data.threads[2].commentCount/json.data.globalComments[0].count*100 * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 )+ "%)</small>" return json; }; const originalJson = window.Response.prototype.json; window.Response.prototype.json = function (...args) { const response = this; return originalJson.apply(this, args).then(json => { if (isTarget(response)) { return changeJson(json); } return json; }); }; })();