x.com to twitter.com

Brings back the twitter.com domain in the URL bar

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         x.com to twitter.com
// @namespace    https://github.com/derpyymuffins
// @version      1.0
// @description  Brings back the twitter.com domain in the URL bar
// @license      MIT
// @author       derpyymuffins
// @match        https://x.com/*
// @icon         https://abs.twimg.com/favicons/twitter.2.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    //  if (document.location.hostname === "x.com") {

const newUrl = document.location.href.replace("x.com", "twitter.com");

const [mainUrl, queryString] = newUrl.split("?");

const queryParams = new URLSearchParams(queryString);

queryParams.set("mx", "1");

document.location.href = `${mainUrl}?${queryParams.toString()}`;

})();