TransparentLC/link-cleaner: 网站链接清洗器
关于项目
这个项目受油猴脚本“Open the F**king URL Right Now”和“redirect 外链跳转”的启发,作用是对以下类型的超链接进行“净化”处理:
- 阻碍用户直达目标网页的“超不链接”
- 清洗前:
https://link.zhihu.com/?target=https%3A//example.com - 清洗后:
https://example.com/
- 清洗前:
- 带有跟踪参数的链接
- 清洗前:
https://b23.tv/r15682i(此链接将跳转到https://www.bilibili.com/video/BV16u411Z7Pj?p=1&share_medium=android&share_plat=android&share_session_id=439a9ce3-414e-4606-98d6-a0098e305a46&share_source=COPY&share_tag=s_i×tamp=1652639989&unique_k=r15682i) - 清洗后:
https://www.bilibili.com/video/av506045471
- 清洗前:
- 隐藏推广、返利参数的链接
- 清洗前:
https://www.vultr.com/?ref=114514 - 清洗后:
https://www.vultr.com/
- 清洗前:
使用方式
提供油猴脚本和 Cloudflare Workers 两种使用方式。
油猴脚本
https://i.akarin.dev/link-cleaner.user.js
脚本会对网页上所有 <a> 标签指向的链接进行清洗。如果你当前打开的页面的 URL 本身可以被清洗,则脚本也会自动跳转到清洗过的 URL。
此外,也可以在菜单中选择手动清洗网页上的所有链接(用于动态添加 <a> 标签的情况)。
Cloudflare Workers
https://i.akarin.dev/link-cleaner/?url=https://example.com/
https://i.akarin.dev/link-cleaner/?title&url=https://example.com/
使用 url 参数输入链接,将返回清洗后的结果。
如果需要获取这个链接对应的网页的标题(<title>),可以在请求时添加 title 参数。
也可以使用 POST 发送带有链接的文本,将文本中的链接清洗后返回。
curl \
--data-raw \
"【淘宝】https://m.tb.cn/h.5Iub7ZVrhwMSERL?sm=xxxxxx?tk=xxxxxxxxxxx ZH4920 「【AmiAmi】Gift 东方 古明地恋 古明地觉 东风谷早苗 fumo」点击链接直接打开 或者 淘宝搜索直接打开" \
https://i.akarin.dev/link-cleaner/
# 【淘宝】https://item.taobao.com/item.htm?id=754327895246 ZH4920 「【AmiAmi】Gift 东方 古明地恋 古明地觉 东风谷早苗 fumo」点击链接直接打开 或者 淘宝搜索直接打开