V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
gogogo1203
V2EX  ›  分享创造

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

  •  3
     
  •   gogogo1203 · 2022-11-30 22:43:29 +08:00 · 3805 次点击
    这是一个创建于 484 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    * {filter: none !important}
    mauve
        5
    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
        6
    Metre  
       2022-12-01 09:52:30 +08:00
    汶川大地震 劲舞团?
    pkwenda
        7
    pkwenda  
       2022-12-01 14:07:19 +08:00
    听说要黑白到 12.07 日
    seelight
        8
    seelight  
       2022-12-01 19:43:48 +08:00
    给楼主的微小工作点赞, 但不建议分享出来, v2 确是法外之地但免不了有心人的"劲舞团".
    bigLinux
        9
    bigLinux  
       2022-12-02 10:40:58 +08:00
    感谢楼主,彩色的好看
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   952 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:28 · PVG 05:28 · LAX 14:28 · JFK 17:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.