您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Show users with badge only.
当前为
// ==UserScript== // @name Twitch Chatroom Essential // @namespace https://wiki.gslin.org/wiki/TwitchChatroomEssential // @version 0.2018.0425 // @description Show users with badge only. // @author Gea-Suan Lin <[email protected]> // @match https://www.twitch.tv/* // @require https://code.jquery.com/jquery-3.3.1.slim.min.js // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; let sheet = document.createElement('style'); sheet.setAttribute('id', 'essential-style'); sheet.innerHTML = '.notessential {display:none;visibility:hidden;}'; document.getElementsByTagName('head')[0].appendChild(sheet); let ctx = document.getElementById('root'); let ob = new window.MutationObserver(function(events){ events.forEach(function(ev){ ev.addedNodes.forEach(function(node){ let el = jQuery(node); if (!el.hasClass('chat-line__message')) { return; } if (0 === el.has('a[data-a-target="chat-badge"]').length) { el.addClass('notessential'); } }); }); }); // tw-full-height tw-flex-grow-1 tw-pd-b-1 ob.observe(ctx, { childList: true, subtree: true, }); })();