Greasy Fork 支持简体中文。

B 站大表情

放大 B 站表情,并在光标指向表情时显示其名称

// ==UserScript==
// @name         B 站大表情
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  放大 B 站表情,并在光标指向表情时显示其名称
// @author       5ec1cff
// @license      AGPL
// @match        *://*.bilibili.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
// @grant        unsafeWindow
// @grant        GM_addStyle
// ==/UserScript==

(function(window) {
    'use strict';

    const selector = 'p.text>img[alt],span.text-con>img[alt],img.bili-rich-text-emoji,img.emoji-large,img.opus-text-rich-emoji';

    GM_addStyle(`${selector} { width: 64px !important; height: 64px !important;  }`);
    GM_addStyle(`.bili-rich-text__content.folded { max-height: unset !important; }`)

    let observer = new MutationObserver(function(mutations, observe) {
        document.querySelectorAll(selector).forEach(e => {
            e.src = e.src.replace('@20w_20h.webp', '@100w_100h.webp');
            e.title = e.alt;
        })
    })
    observer.observe(document.body, { 'childList': true, 'subtree': true });
})(unsafeWindow);