Twitter (X) 伪装成 微博

中国人就用微博

// ==UserScript==
// @name Twitter (X) 伪装成 微博
// @namespace https://github.com/userElaina/this-is-the-China-website
// @version 2024.01.17.02
// @description 中国人就用微博
// @author userElaina
// @license MIT
// @match *://*.twitter.com/*
// @match *://*.x.com/*
// @grant none
// ==/UserScript==

function sleep(time) {
    return new Promise((resolve) => setTimeout(resolve, time));
}

async function f_succ(f, msSleep = 500, maxCount = 10) {
    let count = 0;
    while (true) {
        if (f()) {
            return true;
        }
        count++;
        if (count > maxCount) {
            return false;
        }
        await sleep(msSleep);
    }
}

(async function () {

    // change loading logo
    f_succ(() => {
        let loadingLogo = document.querySelector('div[aria-label="Loading…"]');
        if (loadingLogo === null) {
            return false;
        }
        loadingLogo.childNodes[0].childNodes[0].innerHTML = '<svg height="20px" width="20px" version="1.1" viewBox="0 0 512 512" class="r-18jsvk2 r-4qtqp9 r-yyyyoo r-16y2uox r-8kz0gk r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-lrsllp" aria-hidden="true" xml:space="preserve"> <path style="fill:#EA533B;" d="M403.51,247.992c12.189-23.721,13.499-45.899,3.546-63.137 c-10.316-17.868-31.605-28.033-59.944-28.622c-20.81-0.427-44.439,4.311-68.131,13.528c8.166-27.851,5.532-49.961-7.876-63.369 c-16.113-16.113-44.899-16.666-81.056-1.558c-33.715,14.088-70.764,40.33-104.325,73.889 c-49.982,49.983-83.19,107.958-84.779,147.93C0.318,330.616,0,334.579,0,338.441c0,35.793,25.09,69.017,70.648,93.547 c43.858,23.617,101.979,36.622,163.656,36.622s119.798-13.005,163.656-36.622c45.558-24.53,70.648-57.754,70.648-93.547 C468.609,304.067,445.576,272.184,403.51,247.992z"/> <path style="fill:#D93C1C;" d="M260.338,459.932c-61.677,0-119.798-13.005-163.656-36.622 c-45.558-24.53-70.648-57.754-70.648-93.547c0-3.863,0.318-7.825,0.945-11.787c1.589-39.973,34.797-97.947,84.78-147.93 c33.227-33.226,69.87-59.27,103.314-73.458c-7.854,1.823-16.218,4.566-25.023,8.245c-33.715,14.088-70.764,40.33-104.325,73.889 C35.742,228.707,2.534,286.682,0.945,326.654C0.318,330.616,0,334.579,0,338.441c0,35.793,25.09,69.017,70.648,93.547 c43.858,23.617,101.979,36.622,163.656,36.622c48.616,0,95.016-8.086,133.969-23.074 C335.352,454.941,298.529,459.932,260.338,459.932z"/> <path style="fill:#FFFFFF;" d="M364.19,312.032c-2.568-29.565-22.081-55.61-54.944-73.338 c-31.681-17.091-72.302-24.49-114.382-20.835c-42.079,3.656-80.818,17.949-109.076,40.247 c-29.314,23.131-44.045,52.151-41.476,81.715c2.569,29.565,22.082,55.61,54.946,73.338c26.389,14.236,58.976,21.748,93.447,21.747 c6.913,0,13.905-0.302,20.934-0.913c42.079-3.654,80.817-17.948,109.075-40.246C352.029,370.616,366.758,341.596,364.19,312.032z"/> <path style="fill:#E5E5E5;" d="M230.36,425.319c-7.029,0.611-14.021,0.913-20.934,0.913c-34.471,0.001-67.059-7.511-93.447-21.747 c-32.863-17.729-52.378-43.774-54.946-73.338c-2.569-29.564,12.161-58.584,41.476-81.715c5.799-4.575,12.046-8.808,18.665-12.687 c-12.993,5.932-24.911,13.095-35.388,21.361c-29.314,23.131-44.045,52.151-41.476,81.715c2.569,29.565,22.082,55.61,54.946,73.338 c26.389,14.236,58.976,21.748,93.447,21.747c6.913,0,13.905-0.302,20.934-0.913c33.445-2.905,64.771-12.535,90.41-27.559 C281.994,416.503,256.841,423.019,230.36,425.319z"/> <path style="fill:#333333;" d="M286.65,312.533c-9.507-39.544-55.55-62.508-102.638-51.189 c-47.088,11.32-77.661,52.703-68.156,92.249c4.682,19.473,18.156,35.492,37.943,45.105c12.283,5.967,26.102,9.003,40.355,9.003 c8.042,0,16.221-0.967,24.339-2.918C265.582,393.462,296.157,352.08,286.65,312.533z"/> <circle style="fill:#FFFFFF;" cx="177.898" cy="351.457" r="30.373"/> <g> <path style="fill:#FFA929;" d="M373.152,117.153c-7.189,0-13.017,5.828-13.017,13.017c0,7.189,5.828,13.017,13.017,13.017 	c26.318,0,47.729,21.411,47.729,47.729c0,7.189,5.828,13.017,13.017,13.017s13.017-5.828,13.017-13.017 C446.914,150.243,413.824,117.153,373.152,117.153z"/> <path style="fill:#FFA929;" d="M364.475,43.39c-3.261,0-6.564,0.108-9.817,0.322c-9.564,0.629-16.808,8.893-16.18,18.458 	c0.629,9.564,8.9,16.804,18.458,16.18c2.498-0.164,5.035-0.248,7.539-0.248c62.206,0,112.813,50.608,112.813,112.813 	c0,7.606-0.759,15.204-2.257,22.581c-1.396,6.875,1.691,14.209,7.576,18.025c5.99,3.884,14.111,3.587,19.829-0.675 	c3.388-2.525,5.774-6.307,6.614-10.445c1.958-9.646,2.95-19.566,2.95-29.487C512,109.571,445.82,43.39,364.475,43.39z"/> </g> <circle style="fill:#FFFFFF;" cx="234.305" cy="321.085" r="17.356"/> </svg>';
        return true;
    }, 100, 5);

    // change title
    await f_succ(() => {
        let t = document.title;
        t = t.replace(/[\xA0\u1680\u180e\u2000\u200a\u202f\u205f\u3000]/g, ' ');
        t = t.replace(/\(\d\)/g, '').trim();
        if (t === 'X' || t === 'Twitter') {
            document.title = '微博';
            return true;
        }
        if (t.endsWith(' / X') || t.endsWith(' / Twitter')) {
            document.title = '微博-' + t.substring(0, t.length - 4);
            return true;
        }
        return false;
    });

    // change icon
    await f_succ(() => {
        let icon = document.head.querySelector('[rel="shortcut icon"]');
        if (icon === null) {
            return false;
        }
        icon.href = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADw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i8XQkA0ihkIIBwObBXlOGpqcE6fhmPqFGwVo9EKCtPT393dxL74gujRY4QP/ZbIwUNEP2vB9H2FsNktxTUtnb/7FX2/Efj8conXbOYENay+/UrFsBRc5AplJIKMxUDT0HNz0EYWo5eWoBUVoRUVInTlQYaB6fNh+nzEOs5jfvklpt9vNVQ0DWy2gUZIasU7sAYsN2VT4V1JABIJhkWKRfo9LrampbTihBGDmGGZbqL5apr10fWBfmBmVqcba7J0O/AfkLLtNWwZ6ozQR+pzk7KKbwI1CDEZIYqFQwPhyHCezVgfnAN+q77nfZWee69W7+FKjMoWKUAmAOPVZwzWNNmIQYSLggFrzL0Tq53dgjXheUwVMe1Y0+BXXcSN/x2+zuUGANc7AP83APHcrE+nF6XdAAAAAElFTkSuQmCC";
        return true;
    });

    // change title loop
    f_succ(() => {
        let t = document.title;
        t = t.replace(/[\xA0\u1680\u180e\u2000\u200a\u202f\u205f\u3000]/g, ' ');
        t = t.replace(/\(\d\)/g, '').trim();
        if (t === 'X' || t === 'Twitter') {
            document.title = '微博';
        } else if (t.endsWith(' / X') || t.endsWith(' / Twitter')) {
            document.title = t.substring(0, t.length - 4) + ' - 微博';
        }
        return false;
    }, 2000, 2147483647);

    // change logo
    f_succ(() => {
        let logo = document.querySelector('h1[class="css-175oi2r r-1awozwy r-1pz39u2 r-1loqt21 r-6koalj r-16y2uox r-1777fci r-4wgw6l"]');
        if (logo === null) {
            return false;
        }
        logo.childNodes[0].childNodes[0].innerHTML = '<svg height="40px" width="40px" version="1.1" viewBox="0 0 512 512" class="r-18jsvk2 r-4qtqp9 r-yyyyoo r-16y2uox r-8kz0gk r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-lrsllp" aria-hidden="true" xml:space="preserve"> <path style="fill:#EA533B;" d="M403.51,247.992c12.189-23.721,13.499-45.899,3.546-63.137 c-10.316-17.868-31.605-28.033-59.944-28.622c-20.81-0.427-44.439,4.311-68.131,13.528c8.166-27.851,5.532-49.961-7.876-63.369 c-16.113-16.113-44.899-16.666-81.056-1.558c-33.715,14.088-70.764,40.33-104.325,73.889 c-49.982,49.983-83.19,107.958-84.779,147.93C0.318,330.616,0,334.579,0,338.441c0,35.793,25.09,69.017,70.648,93.547 c43.858,23.617,101.979,36.622,163.656,36.622s119.798-13.005,163.656-36.622c45.558-24.53,70.648-57.754,70.648-93.547 C468.609,304.067,445.576,272.184,403.51,247.992z"/> <path style="fill:#D93C1C;" d="M260.338,459.932c-61.677,0-119.798-13.005-163.656-36.622 c-45.558-24.53-70.648-57.754-70.648-93.547c0-3.863,0.318-7.825,0.945-11.787c1.589-39.973,34.797-97.947,84.78-147.93 c33.227-33.226,69.87-59.27,103.314-73.458c-7.854,1.823-16.218,4.566-25.023,8.245c-33.715,14.088-70.764,40.33-104.325,73.889 C35.742,228.707,2.534,286.682,0.945,326.654C0.318,330.616,0,334.579,0,338.441c0,35.793,25.09,69.017,70.648,93.547 c43.858,23.617,101.979,36.622,163.656,36.622c48.616,0,95.016-8.086,133.969-23.074 C335.352,454.941,298.529,459.932,260.338,459.932z"/> <path style="fill:#FFFFFF;" d="M364.19,312.032c-2.568-29.565-22.081-55.61-54.944-73.338 c-31.681-17.091-72.302-24.49-114.382-20.835c-42.079,3.656-80.818,17.949-109.076,40.247 c-29.314,23.131-44.045,52.151-41.476,81.715c2.569,29.565,22.082,55.61,54.946,73.338c26.389,14.236,58.976,21.748,93.447,21.747 c6.913,0,13.905-0.302,20.934-0.913c42.079-3.654,80.817-17.948,109.075-40.246C352.029,370.616,366.758,341.596,364.19,312.032z"/> <path style="fill:#E5E5E5;" d="M230.36,425.319c-7.029,0.611-14.021,0.913-20.934,0.913c-34.471,0.001-67.059-7.511-93.447-21.747 c-32.863-17.729-52.378-43.774-54.946-73.338c-2.569-29.564,12.161-58.584,41.476-81.715c5.799-4.575,12.046-8.808,18.665-12.687 c-12.993,5.932-24.911,13.095-35.388,21.361c-29.314,23.131-44.045,52.151-41.476,81.715c2.569,29.565,22.082,55.61,54.946,73.338 c26.389,14.236,58.976,21.748,93.447,21.747c6.913,0,13.905-0.302,20.934-0.913c33.445-2.905,64.771-12.535,90.41-27.559 C281.994,416.503,256.841,423.019,230.36,425.319z"/> <path style="fill:#333333;" d="M286.65,312.533c-9.507-39.544-55.55-62.508-102.638-51.189 c-47.088,11.32-77.661,52.703-68.156,92.249c4.682,19.473,18.156,35.492,37.943,45.105c12.283,5.967,26.102,9.003,40.355,9.003 c8.042,0,16.221-0.967,24.339-2.918C265.582,393.462,296.157,352.08,286.65,312.533z"/> <circle style="fill:#FFFFFF;" cx="177.898" cy="351.457" r="30.373"/> <g> <path style="fill:#FFA929;" d="M373.152,117.153c-7.189,0-13.017,5.828-13.017,13.017c0,7.189,5.828,13.017,13.017,13.017 	c26.318,0,47.729,21.411,47.729,47.729c0,7.189,5.828,13.017,13.017,13.017s13.017-5.828,13.017-13.017 C446.914,150.243,413.824,117.153,373.152,117.153z"/> <path style="fill:#FFA929;" d="M364.475,43.39c-3.261,0-6.564,0.108-9.817,0.322c-9.564,0.629-16.808,8.893-16.18,18.458 	c0.629,9.564,8.9,16.804,18.458,16.18c2.498-0.164,5.035-0.248,7.539-0.248c62.206,0,112.813,50.608,112.813,112.813 	c0,7.606-0.759,15.204-2.257,22.581c-1.396,6.875,1.691,14.209,7.576,18.025c5.99,3.884,14.111,3.587,19.829-0.675 	c3.388-2.525,5.774-6.307,6.614-10.445c1.958-9.646,2.95-19.566,2.95-29.487C512,109.571,445.82,43.39,364.475,43.39z"/> </g> <circle style="fill:#FFFFFF;" cx="234.305" cy="321.085" r="17.356"/> </svg>';
        return true;
    });

})();