Greasy Fork

(黑白转换彩色)阳间转换

(黑白转换彩色)阴间使者!使用此脚本可以让你回到阳间。

目前为 2022-12-03 提交的版本。查看 最新版本

// ==UserScript==
// @name         (黑白转换彩色)阳间转换
// @namespace    Null
// @version      0.9
// @description  (黑白转换彩色)阴间使者!使用此脚本可以让你回到阳间。
// @author       Kevin
// @license MIT
// @grant        none
// @match        *://www.bilibili.com/*
// @match        *://*/*
// ==/UserScript==

(function() {
    console.log("来到阳间");
    var URL = window.location.host
    var style=document.createElement('style');
    // 有些另类的网站可以反馈或者用直接替换内容
    //提高优先级
    style.innerHTML=' *{ -webkit-filter:none !important;}';
    document.getElementsByTagName('head')[0].appendChild(style)
    //上面统一处理

//举栗子

console.log("当前网址:"+URL)
if (URL == "www.bilibili.com"){
//哔哩哔哩进行的处理
    var 横幅 = ["//i0.hdslb.com/bfs/archive/0ac04c23af3b3297bf02dca163474326898d211d.png"]
    var Logo = ["//i0.hdslb.com/bfs/archive/5d49497b6b7f30950f37c4aff205e7dd1494f3b9.png"]

    //此处用的为F12 右键 复制 JS路径
    //当然想可以自己再添加点图片
    var 横幅index = Math.round(Math.random()*(横幅.length-1))
    var Logoindex = Math.round(Math.random()*(Logo.length-1))
    document.querySelector("#bili-header-banner-img > source:nth-child(1)").setAttribute("srcset",横幅[横幅index]);
    document.querySelector("#bili-header-banner-img > source:nth-child(2)").setAttribute("srcset",横幅[横幅index]);
    document.querySelector("#bili-header-banner-img > img").setAttribute("srcset",横幅[横幅index]);
    document.querySelector("#i_cecream > div.bili-feed4 > div.bili-header.large-header > div.bili-header__banner > div.header-banner__inner > a > img").setAttribute("srcset",Logo[Logoindex]);



}




})();