Skip to content

Commit ceadfd2

Browse files
committed
feat: 增加 miscellaneous 脚本,防止无法归类的小脚本
1 parent 60c7de3 commit ceadfd2

File tree

8 files changed

+2960
-3331
lines changed

8 files changed

+2960
-3331
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
| [novel-speech-synthesis](/packages/novel-speech-synthesis) | 小说语音阅读功能 | [GitHub](https://github.com/IronKinoko/userscripts/raw/dist/novel-speech-synthesis.user.js) |
2020
| [steam-multisell](/packages/steam-multisell) | Steam 批量出售 | [GitHub](https://github.com/IronKinoko/userscripts/raw/dist/steam-multisell.user.js) |
2121
| [bili-live](/packages/bili-live) | bilibili 直播间优化 | [GitHub](https://github.com/IronKinoko/userscripts/raw/dist/bili-live.user.js) |
22+
| [miscellaneous](/packages/miscellaneous) | 杂项,很多乱七八糟的小功能都写这里面 | [GitHub](https://github.com/IronKinoko/userscripts/raw/dist/miscellaneous.user.js) |
2223

2324
### 其他在用的脚本
2425

packages/miscellaneous/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# miscellaneous
2+
3+
## Install/安装
4+
5+
[Click here/点此](https://github.com/IronKinoko/userscripts/raw/dist/miscellaneous.user.js)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// ==UserScript==
2+
// @name miscellaneous
3+
// @namespace https://github.com/IronKinoko/userscripts/tree/master/packages/miscellaneous
4+
// @version #version#
5+
// @license MIT
6+
// @description #description#
7+
// @author IronKinoko
8+
// @match https://c.pc.qq.com/*
9+
// @icon https://www.google.com/s2/favicons?sz=64&domain=qq.com
10+
// @grant none
11+
// @noframes
12+
// @require https://unpkg.com/jquery@3.6.1/dist/jquery.min.js
13+
// @downloadURL https://github.com/IronKinoko/userscripts/raw/dist/miscellaneous.user.js
14+
// @updateURL https://github.com/IronKinoko/userscripts/raw/dist/miscellaneous.user.js
15+
// ==/UserScript==
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "miscellaneous",
3+
"version": "1.0.0",
4+
"description": "杂项,所有无法归类的脚本都放在这里",
5+
"main": "index.js",
6+
"scripts": {
7+
"dev": "bocchi dev",
8+
"build": "bocchi build"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/IronKinoko/userscripts.git"
13+
},
14+
"keywords": [],
15+
"author": "IronKinoko <kinoko.main@gmail.com>",
16+
"license": "MIT",
17+
"bugs": {
18+
"url": "https://github.com/IronKinoko/userscripts/issues"
19+
},
20+
"homepage": "https://github.com/IronKinoko/userscripts/tree/master/packages/miscellaneous#readme",
21+
"devDependencies": {
22+
"shared": "workspace:*"
23+
}
24+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { router } from 'shared'
2+
import qq from './qq'
3+
4+
router({
5+
domain: 'c.pc.qq.com',
6+
routes: [{ run: qq }],
7+
})

packages/miscellaneous/src/qq.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default function main() {
2+
qqRedirect()
3+
}
4+
5+
function qqRedirect() {
6+
const url = new URL(window.location.href)
7+
8+
if (url.pathname === '/middlem.html') {
9+
const target = url.searchParams.get('pfurl')
10+
if (target) window.location.replace(target)
11+
}
12+
13+
if (url.pathname === '/ios.html') {
14+
const target = url.searchParams.get('url')
15+
if (target) window.location.replace(target)
16+
}
17+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"include": ["src", "../../env.d.ts"]
4+
}

0 commit comments

Comments
 (0)