B站评论区楼层显示

在评论区添加了楼层

  1. // ==UserScript==
  2. // @name B站评论区楼层显示
  3. // @namespace https://aih.im
  4. // @description 在评论区添加了楼层
  5. // @version 1.0
  6. // @author AiHimmel
  7. // @match *://www.bilibili.com/video/*
  8. // @match *://t.bilibili.com/*
  9. // @match *://www.bilibili.com/bangumi/play/*
  10. // @grant none
  11. // @run-at document-end
  12. // @license MIT
  13. // @require https://cdn.jsdelivr.net/npm/core-js-bundle@3.16.1/minified.js
  14. // ==/UserScript==
  15. (function () {
  16. 'use strict';
  17. var raw_appendChild = Node.prototype.appendChild;
  18.  
  19. Node.prototype.appendChild = function (e, ...args) {
  20. var _this = this;
  21. if (e.tagName == 'SCRIPT' && args.length == 0 && e.src.match(/.*comment.*js/)) {
  22.  
  23. document._raw_e = e;
  24. fetch(e.src).then((rsp) => {
  25. return rsp.text();
  26. }).then((t) => {
  27. t = t.replaceAll("this._createReplyBtn(e.rcount)", "this._createReplyBtn(e.rcount),e.floor?'<span>'+e.floor+'楼</span>':''");
  28. var e = document._raw_e
  29. e.textContent = t;
  30. e.removeAttribute('src');
  31. e.id = 'comment_js'
  32. e.onerror = () => {
  33. alert('检测到B站评论区楼层显示脚本错误,请反馈');
  34. };
  35. var ret=raw_appendChild.call(_this, e)
  36. e.onload();
  37. return ret
  38.  
  39. })
  40.  
  41. } else {
  42.  
  43. return raw_appendChild.call(_this, e, ...args);
  44.  
  45. }
  46. }
  47.  
  48.  
  49.  
  50.  
  51.  
  52. })();

QingJ © 2025

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