B 站大表情

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

  1. // ==UserScript==
  2. // @name B 站大表情
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.1
  5. // @description 放大 B 站表情,并在光标指向表情时显示其名称
  6. // @author 5ec1cff
  7. // @license AGPL
  8. // @match *://*.bilibili.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
  10. // @grant unsafeWindow
  11. // @grant GM_addStyle
  12. // ==/UserScript==
  13.  
  14. (function(window) {
  15. 'use strict';
  16.  
  17. const selector = 'p.text>img[alt],span.text-con>img[alt],img.bili-rich-text-emoji,img.emoji-large,img.opus-text-rich-emoji';
  18.  
  19. GM_addStyle(`${selector} { width: 64px !important; height: 64px !important; }`);
  20. GM_addStyle(`.bili-rich-text__content.folded { max-height: unset !important; }`)
  21.  
  22. let observer = new MutationObserver(function(mutations, observe) {
  23. document.querySelectorAll(selector).forEach(e => {
  24. e.src = e.src.replace('@20w_20h.webp', '@100w_100h.webp');
  25. e.title = e.alt;
  26. })
  27. })
  28. observer.observe(document.body, { 'childList': true, 'subtree': true });
  29. })(unsafeWindow);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址