Mobile Bilibili Optimize

BILIBILI

  1. // ==UserScript==
  2. // @name Mobile Bilibili Optimize
  3. // @namespace http://tampermonkey.net/
  4. // @version 2025-03-12
  5. // @description BILIBILI
  6. // @author You
  7. // @license MIT
  8. // @match *://*.bilibili.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. /**
  16. addCssBlock("#app > div > div.suspension > div > div.m-navbar > div > m-open-app");
  17. addCssBlock(".m-fixed-openapp");
  18. addCssBlock(".openapp-btn");
  19.  
  20. const observer = new MutationObserver((MutationList)=>{
  21. for(const mutation of MutationList) {
  22. if(mutation.type === "attributes") {
  23. alert("hi")
  24. }
  25. }
  26. })
  27. const target = document.getElementByClassName("m-fixed-openapp");
  28. const config = {attributes:true};
  29. observer.observe(target,true);
  30.  
  31. function addCssBlock(SelectorTxt) {
  32. // document.querySelector(SelectorTxt).style.display = "none"
  33. document.querySelector(SelectorTxt).hidden = true;
  34. }
  35. **/
  36. function addEleBlock(selector) {
  37. if(document.querySelector(selector)) {
  38. document.querySelector(selector).style.display = 'none'
  39. }
  40. }
  41.  
  42. const observer = new MutationObserver(()=>{
  43. addEleBlock('div.m-fixed-openapp')
  44. addEleBlock('div.openapp-btn')
  45. addEleBlock('.slide-ad-exp')
  46. addEleBlock('.video-page-game-card-small')
  47. addEleBlock('.m-open-app.m-nav-openapp')
  48. addEleBlock('.openapp-dialog')
  49. console.log('屏蔽成功')
  50. })
  51. const observerOptions = {
  52. childList: true,
  53. subtree: true,
  54. };
  55. observer.observe(document.body,observerOptions);
  56. document.getElementsByTagName('title')[0].innerHTML = 'B站'
  57. })();

QingJ © 2025

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