您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
B站直播间同接数显示
当前为
// ==UserScript== // @name BiiOnlineHook // @description B站直播间同接数显示 // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author jeffz615 // @match *://live.bilibili.com/* // @icon https://live.bilibili.com/favicon.ico // @sandbox MAIN_WORLD // @license MIT // ==/UserScript== (function() { 'use strict'; function hook_wrapper() { let g_rank_count = 0; let g_online_count = 0; function on_online_rank_count(obj) { const rank_count = obj.data.count; const online_count = obj.data.online_count; let flag = false; if (rank_count && rank_count !== g_rank_count) { g_rank_count = rank_count; flag = true; } if (online_count && online_count !== g_online_count) { g_online_count = online_count; flag = true; } if (flag) { const shower = document.querySelector("#rank-list-ctnr-box > div.tabs > ul > li.item.live-skin-normal-text.dp-i-block.live-skin-separate-border.border-box.t-center.pointer.active") shower.innerText = '高能用户(' + g_rank_count + '/' + g_online_count + ')'; } } const cb_map = { "ONLINE_RANK_COUNT": on_online_rank_count, }; Array.prototype.push = new Proxy(Array.prototype.push, { apply(target, thisArg, argArray) { try { if (argArray && argArray.length > 0) { for (let i = 0; i < argArray.length; i++) { if (argArray[i] && argArray[i].cmd) { if (cb_map[argArray[i].cmd]) { cb_map[argArray[i].cmd](argArray[i]); } } else { break; } } } } catch (e) { console.error(e); } return Reflect.apply(target, thisArg, argArray); } }); } hook_wrapper(); /* let hookScript = document.createElement('script'); hookScript.textContent = '(' + hook_wrapper + ')()'; (document.head||document.documentElement).appendChild(hookScript); hookScript.parentNode.removeChild(hookScript); */ })();