当生活失去了色彩,,,,,,,那就

2022-11-30 22:43:29 +08:00
 gogogo1203

学编程, 自己去除。 油猴插件,自己装。 百度灰叫 big-event-gray. 自己搞吧. 很烦很惭愧,一天到晚就是些微小的工作。

// ==UserScript==
// @name         色彩
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  b 站、微博、douyu 、网易云 加入颜色。
// @author       wallace
// @match      *www.douyu.com/*
// @match      *www.bilibili.com/*
// @match      *://weibo.com/*
// @match      *music.163.com/*

// @grant        none
// ==/UserScript==
(function() {
    'use strict';
    var elems = document.querySelector(':root');

    if(top.window.location.href.indexOf("weibo.com") > -1){
      var els = document.querySelectorAll(".grayTheme");
      [].forEach.call(els, function(el) {
    el.className = el.className.replace(/\grayTheme\b/, "mmm");});
        return
      }

   if(top.window.location.href.indexOf("music.163.com") > -1){
     elems.style.webkitFilter = "grayscale(0)";
    elems.style.filter = "grayscale(0)";
       return
      }
 

   if(top.window.location.href.indexOf("bilibili.com") > -1){
  elems.classList.remove("gray");
       return
      }

  if(top.window.location.href.indexOf("douyu.com") > -1){
   elems.classList.remove("grayCtrl");
       return
      }
 


})();
3845 次点击
所在节点    分享创造
9 条回复
daiv
2022-11-30 22:50:16 +08:00
match 改成 include 才能用,为啥?
gogogo1203
2022-11-30 22:54:49 +08:00
@daiv 版本不一样. 我看编辑器提示 @include 要取消了
qdsearoc
2022-11-30 23:30:08 +08:00
我的第一个油猴脚本,今天多哈了一瓶酒
lchynn
2022-12-01 08:52:13 +08:00
CSS 加一句就可以了

* {filter: none !important}
mauve
2022-12-01 09:45:39 +08:00
微博这样会更彻底
if (top.window.location.href.indexOf("weibo.com") > -1) {
document.querySelectorAll('style')[3].remove()
return
}
Metre
2022-12-01 09:52:30 +08:00
汶川大地震 劲舞团?
pkwenda
2022-12-01 14:07:19 +08:00
听说要黑白到 12.07 日
seelight
2022-12-01 19:43:48 +08:00
给楼主的微小工作点赞, 但不建议分享出来, v2 确是法外之地但免不了有心人的"劲舞团".
bigLinux
2022-12-02 10:40:58 +08:00
感谢楼主,彩色的好看

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/899196

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX