V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
gogogo1203

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

  •  3
     
  •   gogogo1203 · Nov 30, 2022 · 5070 views
    This topic created in 1251 days ago, the information mentioned may be changed or developed.

    学编程, 自己去除。 油猴插件,自己装。 百度灰叫 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
          }
     
    
    
    })();
    
    9 replies    2022-12-02 10:40:58 +08:00
    daiv
        1
    daiv  
       Nov 30, 2022
    match 改成 include 才能用,为啥?
    gogogo1203
        2
    gogogo1203  
    OP
       Nov 30, 2022   ❤️ 1
    @daiv 版本不一样. 我看编辑器提示 @include 要取消了
    qdsearoc
        3
    qdsearoc  
       Nov 30, 2022   ❤️ 2
    我的第一个油猴脚本,今天多哈了一瓶酒
    lchynn
        4
    lchynn  
       Dec 1, 2022
    CSS 加一句就可以了

    * {filter: none !important}
    mauve
        5
    mauve  
    PRO
       Dec 1, 2022
    微博这样会更彻底
    if (top.window.location.href.indexOf("weibo.com") > -1) {
    document.querySelectorAll('style')[3].remove()
    return
    }
    Metre
        6
    Metre  
       Dec 1, 2022
    汶川大地震 劲舞团?
    pkwenda
        7
    pkwenda  
       Dec 1, 2022
    听说要黑白到 12.07 日
    seelight
        8
    seelight  
       Dec 1, 2022
    给楼主的微小工作点赞, 但不建议分享出来, v2 确是法外之地但免不了有心人的"劲舞团".
    bigLinux
        9
    bigLinux  
       Dec 2, 2022
    感谢楼主,彩色的好看
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2766 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 08:26 · PVG 16:26 · LAX 01:26 · JFK 04:26
    ♥ Do have faith in what you're doing.