Hide your twitter info

Hide your Twitter information. Prevent others from seeing your ID, nickname, and profile picture in public places.

目前为 2024-05-17 提交的版本。查看 最新版本

// ==UserScript==
// @name         Hide your twitter info
// @namespace    https://github.com/KazooTTT/hide-your-twitter-info
// @version      0.4
// @description  Hide your Twitter information. Prevent others from seeing your ID, nickname, and profile picture in public places.
// @author       KazooTTT
// @match        https://*.twitter.com/
// @match        https://*.x.com/
// @icon         https://github.com/kazoottt.png
// @license      MIT
// @grant        none
// ==/UserScript==

const insertStylesBySelector = (selector) => {
  const style = document.createElement("style");
  style.textContent = `
${selector} {
display:none
}
`;
  const head = document.querySelector("head");
  head.append(style);
};

(function () {
  "use strict";
  insertStylesBySelector(`[data-testid="SideNav_AccountSwitcher_Button"] > div:nth-child(1)`);
  insertStylesBySelector(`[data-testid="SideNav_AccountSwitcher_Button"] > div:nth-child(2)`);

  const timer = setInterval(() => {
    const accountEl = document.querySelector(
      'a[data-testid="AppTabBar_Profile_Link"]'
    );
    if (accountEl) {
      const accountId = accountEl.href.split("/").pop();
      insertStylesBySelector(
        `div[data-testid="UserAvatar-Container-${accountId}"]`
      );
      clearInterval(timer);
    }
  }, 1500);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址