B站直播间黑听模式

使用按钮隐藏播放器的显示,但是能听得到并且可以发弹幕

  1. // ==UserScript==
  2. // @name B站直播间黑听模式
  3. // @namespace http://shenhaisu.cc/
  4. // @version 1.5
  5. // @description 使用按钮隐藏播放器的显示,但是能听得到并且可以发弹幕
  6. // @author ShenHaiSu_KimSama
  7. // @match https://live.bilibili.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
  9. // @grant none
  10. // @license MIT
  11. // @noframes
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. let displayMode = true;
  16. let newNode = document.createElement("button");
  17. let targetElement = null;
  18. newNode.innerText = "显";
  19. newNode.className = "icon-item danmu-block-icon live-skin-main-text";
  20. newNode.style.minWidth = "24px";
  21. newNode.style.minHeight = "24px";
  22. newNode.style.fontSize = "14px";
  23. newNode.style.padding = "0";
  24. newNode.style.backgroundColor = "black";
  25.  
  26. newNode.addEventListener("click", () => {
  27. targetElement = document.querySelector("video[id]");
  28. displayMode = !displayMode;
  29. newNode.innerText = displayMode ? "显" : "隐";
  30. targetElement.style.display = displayMode ? "" : "none";
  31. });
  32.  
  33. setTimeout(() => {
  34. document.querySelector(".icon-left-part").appendChild(newNode);
  35. document.querySelector("div.shop-popover").style.display = "none";
  36. }, 5000);
  37.  
  38. setInterval(function(){
  39. targetElement = document.querySelector("video[id]");
  40. newNode.innerText = displayMode ? "显" : "隐";
  41. targetElement.style.display = displayMode ? "" : "none";
  42. }, 5000);
  43. })();

QingJ © 2025

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