Greasy Fork 还支持 简体中文。

直播顺畅

一个替换logo的脚本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         直播顺畅
// @version      0.1.3
// @description  一个替换logo的脚本
// @author       You
// @match        https://*.google.com/*
// @match        https://www.google.co.jp/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=google.co.jp
// @license      MIT
// @namespace http://tampermonkey.net/
// ==/UserScript==

(function () {
    'use strict';

    // Your code here...

    // 检测是主页面还是搜索结果界面
    var main_page_classname = "lnXdpd";
    var baidu_logo = "https://www.baidu.com/img/pcdoodle_2a77789e1a67227122be09c5be16fe46.png";
    var currentUrl = window.location.href;
    var pattern = /^https?:\/\/(www\.)?google\.[a-z]{2,3}(?:\.[a-z]{2})?(?:\/|$)/;

    if (pattern.test(currentUrl)) {
        // 主页
        var logoImg = document.getElementsByClassName(main_page_classname).item(0);
        var newLogoImg = document.createElement('img');
        newLogoImg.src = baidu_logo;
        newLogoImg.width = 272;
        logoImg.parentNode.removeChild(logoImg.parentNode.firstChild);
        logoImg.parentNode.replaceChild(newLogoImg, logoImg);

        // 修改下方的小字
        var searchGoogle = document.getElementsByClassName("gNO89b");
        searchGoogle[0].value = "百度一下";

        //
        var aboutGoogle = document.getElementsByClassName("pHiOh");
        console.log(aboutGoogle);
        aboutGoogle[0].innerHTML = "关于百度";
        aboutGoogle[3].innerHTML = "百度搜索的运作方式";
    } else {
        // 搜索页
    }

})();