Greasy Fork is available in English.

网站样式增强

站点logo、样式调整,居家摸鱼必备

// ==UserScript==
// @name         网站样式增强
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  站点logo、样式调整,居家摸鱼必备
// @author       zherop@163.com
// @match        *://*/*
// @require      https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js
// @grant unsafeWindow
// @grant GM_openInTab
// @license      AGPL License
// ==/UserScript==

(function() {
    'use strict';

    var logoFile = 'https://cdn.efunds.com.cn/owch/upload/resources/image/2021/11/04/1040.png';
    var ico = 'https://www.efunds.com.cn/assets/images/favicon.ico';
    var logoURL = 'https://www.efunds.com.cn/';

    // 处理部分站点的样式
    function handleSiteStyle() {
       if(window.location.href.startsWith("https://xueqiu.com")) {
           // 雪球
           $('link[rel="shortcut icon"]').attr("href",ico)
           $(".nav__logo").css('background','url('+ logoFile +') no-repeat 50%');
           $(".nav__logo").css('background-size','100% 100%');
           $(".nav").css('background-color','#bebebe');
           $(".nav__logo").attr("href",logoURL)
       }
       if(window.location.href.startsWith("http://www.iwencai.com/")) {
           // i问财
           $(".wencai-logo-link").attr("href",logoURL);
           $(".wencai-logo").attr("src",logoFile);
           $('link[rel="icon"]').attr("href",ico);
       }
    }

    $(function(){
        // 处理网站样式
         handleSiteStyle();
    })
})();