Xbout is a lightweight enhancement script for X (Twitter). It intuitively displays the account's location (π), posting device (π±), and registration year (π ) next to the user's name in tweets.
This version is a Userscript (Tampermonkey script) refactored from the original Chrome extension, deeply optimized for performance and anti-detection, supporting script managers like Tampermonkey and Violentmonkey.
@elonmusk Β· Nov 24 Β· πΊπΈο½πο½2009
- πΊπΈ: Account location is in the United States
- π: Sent using iPhone
- 2009: Registered in 2009
- π Location Display: Automatically converts the account's geographical location information into corresponding flag emojis (supports 100+ countries/regions).
- π± Device Recognition: Identifies and displays the source device of the tweet:
- π Apple (iPhone, iPad, Mac)
- π€ Android
- π» Web (Browser)
- π Registration Year: Shows the year the account joined X (Twitter) (e.g., 2009).
- π« Ad Marking: Automatically identifies and marks promoted tweets (Ad).
- π Dark Mode: Perfectly adapts to X's light, dim, and dark modes.
Compared to traditional extensions, this script version includes several core optimizations designed to provide a smoother and safer experience:
- Smart On-Demand Loading (Intersection Observer):
- Requests data only when tweets appear in the screen's viewable area, significantly reducing network requests and improving page scrolling smoothness.
- Anti-Detection Mechanism:
- Random Delays: Adds 2-4 second random intervals between requests to simulate human behavior.
- Rate Limit Handling: Automatically detects API rate limits (429 errors), pauses requests for 5 minutes upon triggering to prevent temporary account blocking.
- Efficient Caching System:
- Data cache time extended to 7 days, greatly reducing duplicate requests.
- Uses
GM_setValue/GM_getValuefor persistent storage, retaining data across sessions.
- Dynamic Query ID Acquisition:
- Automatically captures the latest GraphQL Query ID from network requests, ensuring the API interface remains valid long-term without frequent script updates.
- Install Manager:
- First, install a userscript manager in your browser. It is recommended to use Tampermonkey or Violentmonkey.
- Install Script:
- Visit Greasy Fork and click install.
- Or directly download the
xbout.user.jsfile from this project and drag it into the browser's extension management page.
- Usage:
- Visit x.com or twitter.com, and the script will run automatically.
- Data Source:
- Fetches public account information through X's GraphQL API (
AboutAccountQuery). - Utilizes
IntersectionObserverandMutationObserverto monitor DOM changes.
- Fetches public account information through X's GraphQL API (
- Permission Description:
GM_addStyle: Injects styles.GM_getValue/GM_setValue: Reads and writes local cache.- The script only runs on
x.comandtwitter.comdomains.
MIT License