Ching L 16f8056867 feat: add mastodon alt text modal auto-skip script
- Created new Tampermonkey script to automatically skip Alt text confirmation modal on Mastodon
- Auto-detects and clicks "就这样发布" button when posting images without alt text
- Uses MutationObserver for efficient DOM monitoring
- Updated README with script documentation and usage instructions
2025-11-03 11:01:48 +08:00

101 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Tampermonkey Scripts Collection
一个 Tampermonkey 脚本集合,包含多个用于增强不同网站功能的脚本。
## 脚本列表
### 1. 51吃瓜网助手 (`51cg-helper.user.js`)
用于增强 51吃瓜网 (51cg1.com) 浏览体验的脚本。
#### 功能特性
##### 隐藏热搜帖子
- 一键隐藏所有带有"热搜 HOT"标签的帖子
- 同时自动隐藏广告帖子
- 开关状态会自动保存,刷新页面后保持设置
- 仅在列表页生效,不影响文章内容页的正常显示
##### 标记已读帖子
- 点击过的帖子会自动标记为已读状态
- 已读帖子视觉效果:
- 标题添加删除线
- 图片变为黑白色
- 整体透明度降低
- 自动管理已读记录:
- 最多保存 1000 条最近的已读记录
- 超过限制自动删除最旧的记录FIFO 策略)
- 无需手动清理
##### 控制面板
- 固定在页面右侧的控制面板
- 包含两个开关:
- 隐藏热搜:控制是否隐藏热搜和广告帖子
- 标记已读:控制是否启用已读标记功能
- 支持深色模式自动适配
#### 安装使用
1. 安装 Tampermonkey 扩展
2. 打开脚本文件 `51cg-helper.user.js`
3. 复制内容到 Tampermonkey 新建脚本
4. 保存并启用脚本
5. 访问 51cg1.com 即可看到右侧控制面板
---
### 2. Mastodon 自动跳过图片 Alt 提示 (`mastodon-skip-alt-modal.user.js`)
在 Mastodon 发送带图片的消息时自动跳过 Alt 文本提示弹窗的脚本。
#### 功能特性
- 自动检测 Alt 文本提示弹窗
- 自动点击"就这样发布"按钮
- 无需手动确认,提升发布效率
- 使用 MutationObserver 监听 DOM 变化,确保及时响应
- 控制台日志输出,方便调试
#### 适用网站
- https://nofan.xyz
- 其他 Mastodon 实例(可能需要调整 @match 规则)
#### 安装使用
1. 安装 Tampermonkey 扩展
2. 打开脚本文件 `mastodon-skip-alt-modal.user.js`
3. 复制内容到 Tampermonkey 新建脚本
4. 保存并启用脚本
5. 访问 Mastodon 网站,上传图片并点击发布,脚本会自动跳过 Alt 提示
---
### 3. Sort Jable Videos by Like Count (`sortbylikecount.js`)
按点赞数排序 Jable 视频的脚本。
---
## 通用安装方法
1. **安装 Tampermonkey 扩展**
- [Chrome](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo)
- [Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/)
- [Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd)
2. **安装脚本**
- 打开 Tampermonkey 管理面板
- 点击"添加新脚本"
- 复制对应脚本文件的内容
- 保存脚本Ctrl+S 或 Cmd+S
## 文件结构
```
tampermonkey-script/
├── README.md # 本文档
├── 51cg-helper.user.js # 51吃瓜网助手脚本
├── mastodon-skip-alt-modal.user.js # Mastodon 自动跳过 Alt 提示脚本
└── sortbylikecount.js # Jable 排序脚本
```