Restore Twitter Logo

Restores the default blue bird Twitter logo and removes the dog logo forced by Elon Musk

ของเมื่อวันที่ 06-04-2023 ดู เวอร์ชันล่าสุด

// ==UserScript==
// @name         Restore Twitter Logo
// @description  Restores the default blue bird Twitter logo and removes the dog logo forced by Elon Musk
// @namespace    https://www.example.com/
// @version      1.5
// @author       noxljlfsd
// @grant        none
// @match        https://twitter.com/*
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function chageDogLogo() {
        //if(true||document.readyState === 'complete') {
            // Set the default Twitter logo URL
            const defaultLogoUrl = 'https://abs.twimg.com/responsive-web/client-web/icon-ios.8ea219d5.png';
            // Find the Twitter logo element and restore the default logo
            const twitterLogo = document.querySelector("#react-root > div > div > div.css-1dbjc4n.r-18u37iz.r-13qz1uu.r-417010 > header > div > div > div > div:nth-child(1) > div.css-1dbjc4n.r-dnmrzs.r-1vvnge1 > h1 > a > div > svg");
            if (twitterLogo) {
                twitterLogo.outerHTML = `<image xlink:href="${defaultLogoUrl}" src="${defaultLogoUrl}" style="width:1.75rem;height:1.75rem;" alt="">`;
                return true;
            }
            else { return false;}

        //}
    }
    let tryTimes = 0;
    function TryChageLogo(){
        let times = 0;
        let tryResult = chageDogLogo();
        if(times++ <30 && !tryResult){
            setTimeout(TryChageLogo,1000);
        }
    }
    document.onreadystatechange = TryChageLogo;
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。