Greasy Fork is available in English.
将推特推文中的 t.co 链接替换为实际显示的完整 URL(如果可行),并阻止 t.co 跳转跟踪,让点击直接访问目标网站。脚本能够还原被 Twitter 隐藏的完整链接文本。
当前为
# Twitter/X t.co Direct Link & Full URL (推特 t.co 直连与完整链接还原)
---
### 简介
这是一个旨在优化 Twitter (X.com) 浏览体验的脚本。它解决了推特强制缩短链接文本以及通过 `t.co` 进行重定向跟踪的问题。
### 核心功能
1. **还原完整链接 (Full URL Restoration)**
推特通常会将较长的 URL 截断显示(例如显示为 `example.com/posts/ve...`)。本脚本利用推特页面中隐藏的元数据,将这些被截断的文本**完美还原为完整的 URL**,让你在点击之前就能清楚地看到完整的网址。
2. **移除 t.co 跳转 (Direct Link / Anti-Tracking)**
将原本指向 `t.co` 的链接替换为直连地址。点击链接时,**直接访问目标网站**,不再经过推特的追踪服务器。这不仅保护了隐私,还加快了页面跳转速度。
3. **布局保护**
对于还原后极长的链接,脚本会自动应用 `word-break: break-all` 样式,确保长链接会自动换行,不会破坏推文的排版布局。
### 效果对比
| 状态 | 显示文本 (示例) | 点击行为 |
| :--- | :--- | :--- |
| **默认 (Default)** | `fatbobman.com/zh/posts/creat…` | 访问 `t.co/xyz` -> 跳转到目标网站 (有延迟,有追踪) |
| **开启脚本 (Active)** | `https://fatbobman.com/zh/posts/creating-stunning-dynamic-text-effects-with-textrender/` | **直接访问** 目标网站 (无延迟,无追踪) |
### 常见问题
* **适用范围**:脚本主要针对推文正文中的**文本链接**。为了保持界面美观,推特卡片(带有预览图的大方块链接)不会被修改显示文本,但点击时仍会尝试去除 t.co 跳转。
* **兼容性**:支持 Twitter.com 和 X.com。
---
### Introduction
This script enhances your browsing experience on Twitter (X.com) by handling external links more intelligently. It addresses the annoyance of truncated link text and bypasses the mandatory `t.co` redirection service.
### Features
1. **Reveal Full URLs**
Twitter often truncates long URLs in tweets (e.g., displaying `example.com/posts/ve...`). This script recovers the hidden text from the DOM and **restores the full, original URL** in the tweet. You can see exactly where a link leads before you click it.
2. **Bypass t.co Redirection (Direct Links)**
Replaces `t.co` links with the actual destination URL. When you click a link, you go **directly to the target site**, bypassing Twitter's tracking server. This improves privacy and loading speed.
3. **Layout Safe**
For very long restored URLs, the script applies `word-break` styling to ensure the text wraps correctly and doesn't break the tweet's layout.
### Comparison
| Status | Display Text (Example) | Click Behavior |
| :--- | :--- | :--- |
| **Default** | `fatbobman.com/zh/posts/creat…` | Visits `t.co/xyz` -> Redirects to target (Slower, Tracked) |
| **With Script** | `https://fatbobman.com/zh/posts/creating-stunning-dynamic-text-effects-with-textrender/` | **Directly visits** target (Faster, No Tracking) |
### Notes
* **Scope**: This script primarily targets **text links** within tweets. To preserve the UI aesthetics, "Link Cards" (large preview boxes) are visually left unchanged, though the script still attempts to bypass the t.co redirect for them where possible.
* **Compatibility**: Works on both Twitter.com and X.com.
---