MuteGreyTheme

移除灰色模式

  1. // ==UserScript==
  2. // @name MuteGreyTheme
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 移除灰色模式
  6. // @author You
  7. // @match *://weibo.com/*
  8. // @match *://www.mgtv.com/
  9. // @match *://www.bilibili.com/
  10. // @match *://*.baidu.com/
  11. // @match *://v.qq.com/*
  12. // @icon https://www.google.com/s2/favicons?sz=64&domain=mgtv.com
  13. // @grant unsafeWindow
  14. // @grant GM_log
  15. // @license MIT
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20. GM_log('开始啦')
  21. window.onload=function(){
  22. //腾讯视频
  23. if (document.querySelectorAll(".gray-style-remembrance").length > 0) {
  24. GM_log('更新style')
  25. document.querySelectorAll(".gray-style-remembrance").forEach( a => {
  26. a.classList.remove('gray-style-remembrance')
  27. })
  28. setTimeout(e => {
  29. GM_log('延迟更新style')
  30. document.querySelectorAll(".gray-style-remembrance").forEach( a => {
  31. a.classList.remove('gray-style-remembrance')
  32. })
  33. }, 1000 )
  34. } else
  35. //b站
  36. if(document.querySelector('html').getAttribute('class') === 'gray'){
  37. GM_log('B站逻辑')
  38. document.querySelector('html').removeAttribute('class', 'gray');
  39. } else
  40. //芒果
  41. if(document.querySelector('body').getAttribute('class') === 'page-gray'){
  42. GM_log('芒果逻辑')
  43. document.querySelector('body').removeAttribute('class', 'page-gray');
  44. } else
  45. //百度
  46. if(document.querySelector('body').getAttribute('class') === 'big-event-gray'){
  47. GM_log('百度逻辑')
  48. document.querySelector('body').removeAttribute('class', 'big-event-gray');
  49. } else
  50. //微博 一定是放最后
  51. if (document.querySelectorAll("style").length > 0) {
  52. GM_log('微博逻辑')
  53. document.querySelectorAll("style").forEach( a => {
  54. if(a.innerHTML.includes('grayTheme')){
  55. GM_log('更新style')
  56. a.innerHTML=''
  57. }
  58. })
  59. }
  60. }
  61. })();

QingJ © 2025

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