├── .gitignore ├── rawgithub ├── cf.jpg ├── raw.js └── readme.md ├── readme.md ├── betterweb ├── jianshu.conf ├── baiduPan.conf ├── v2ex.js ├── stackoverflow.snippet ├── smzdm.conf ├── readme.md ├── csdn.conf ├── zhihu.conf ├── jianshu.js ├── csdn.req.js ├── baiduPan.js ├── stackoverflow.js ├── csdn.res.js ├── smzdm.res.js ├── zhihux.user.js └── baidu.user.js ├── nodeToSub ├── getShow.js ├── nodeToSub.js └── Readme.md ├── justopenit └── justopenit.conf ├── shortcuts └── readme.md ├── google ├── google_noredirect.js ├── rewriteG.conf ├── simplifyurl.js └── Endless_Google.user.js ├── tgbotmessage.js ├── tamperJSLog.js └── cookieshow.js /.gitignore: -------------------------------------------------------------------------------- 1 | .git -------------------------------------------------------------------------------- /rawgithub/cf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/HEAD/rawgithub/cf.jpg -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## 一些自制的 QUANX 小工具 2 | 3 | 更新频道: https://t.me/elecV2 4 | 5 | *其他软件理论上也能用(没测试,不保证)* 6 | 7 | - 手机网页显示优化系列 [betterweb](https://github.com/elecV2/QuantumultX-Tools/tree/master/betterweb) 8 | - 捷径系列 [shortcuts](https://github.com/elecV2/QuantumultX-Tools/tree/master/shortcuts) -------------------------------------------------------------------------------- /rawgithub/raw.js: -------------------------------------------------------------------------------- 1 | // 复制本文件代码到 cloudflare worker,搭建自己的加速服务器 2 | 3 | addEventListener( 4 | "fetch",event => { 5 | let url=new URL(event.request.url); 6 | url.hostname="raw.githubusercontent.com"; 7 | let request=new Request(url,event.request); 8 | event.respondWith( 9 | fetch(request) 10 | ) 11 | } 12 | ) -------------------------------------------------------------------------------- /rawgithub/readme.md: -------------------------------------------------------------------------------- 1 | CDN 加速直连 raw.githubusercontent.com 2 | 3 | ``` 4 | [rewrite] 5 | ^https://raw.githubusercontent.com url 307 https://raw.ev2.workers.dev 6 | 7 | [mitm] 8 | raw.githubusercontent.com 9 | ``` 10 | 11 | 说明: 12 | 13 | - CDN 服务器使用的是CF workers,每日请求限额10万次 14 | - 请勿使用302/307 重定向到一个你不信任的网址,建议自己搭一个,免费且更安全 15 | 16 | ![](./cf.jpg) -------------------------------------------------------------------------------- /betterweb/jianshu.conf: -------------------------------------------------------------------------------- 1 | // 规则仅对手机网页版有效,如使用APP 请勿添加 2 | // 更新频道:https://t.me/elecV2 3 | 4 | hostname = www.jianshu.com 5 | 6 | // 先重写到桌面版 7 | ^https:\/\/www\.jianshu\.com\/p url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36$2 8 | 9 | // 再注入 CSS 进行优化 10 | ^https:\/\/www\.jianshu\.com\/p url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/jianshu.js -------------------------------------------------------------------------------- /nodeToSub/getShow.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** 功能:将链接 GET 变量 bstr 中的字符直接输出 3 | ** 使用:将代码直接拷贝到 cloudflare workers 即可 4 | *** 5 | ** 注意:GET传递字符量有限(2000~左右) 6 | */ 7 | 8 | async function handleRequest(data) { 9 | const init = { 10 | headers: { 11 | 'content-type': 'text/plain;charset=UTF-8', 12 | }, 13 | } 14 | return new Response(data, init) 15 | } 16 | 17 | addEventListener('fetch', event => { 18 | let url = new URL(event.request.url) 19 | let info = url.searchParams.get('bstr') 20 | let bstr = info ? info : 'author: elecV2\n\ngithub: https://github.com/elecV2' 21 | return event.respondWith(handleRequest(bstr)) 22 | }) -------------------------------------------------------------------------------- /betterweb/baiduPan.conf: -------------------------------------------------------------------------------- 1 | // 百度网盘手机网页优化。 (APP 用户请勿添加) 2 | // 可直接下载视频/音频/zip 等文件 3 | // 更新频道:https://t.me/elecV2 4 | // QuantumultX rewrite 订阅地址: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/baiduPan.conf 5 | 6 | hostname = pan.baidu.com 7 | 8 | // 先重写到桌面版 9 | ^https:\/\/pan\.baidu\.com url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36$2 10 | 11 | // 再注入 CSS 进行优化 12 | ^https:\/\/pan\.baidu\.com url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/baiduPan.js -------------------------------------------------------------------------------- /justopenit/justopenit.conf: -------------------------------------------------------------------------------- 1 | hostname = link.csdn.net, link.jianshu.com, link.zhihu.com, redirect.ruguoapp.com, www.google.com 2 | 3 | // [rewrite_local] 4 | // 移除简书跳转第三方网站的中间提醒 5 | ^https://link\.jianshu\.com/\?t=(.*) url 307 $1 6 | 7 | // 移除CSDN跳转第三方网站的中间提醒 8 | ^https?://link\.csdn\.net/api/v1/link/check\?url=(.*) url 302 $1 9 | 10 | // 移除即刻跳转第三方网站的中间提醒(好像无效) 11 | // ^https://redirect\.ruguoapp\.com/\?redirect=(https?)%3A%2F%2F(.*) url 307 $1://$2 12 | 13 | // 移除知乎跳转第三方网站的中间提醒 14 | ^https?://link\.zhihu\.com/\?target=(https?)%3A//(.*) url 307 $1://$2 15 | 16 | // 移除 Google 搜索结果中的重定向 17 | ^https://www\.google\.com/url.+url=(https?)%3A%2F%2F([^%]+)%2F([^&]+) url 307 $1://$2/$3 18 | -------------------------------------------------------------------------------- /betterweb/v2ex.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称:v2ex.js 3 | * 4 | ******** (已修改) 以下为 tamperJS 自动生成的 rewrite 相关信息,可能需要根据情况适当调整 ******** 5 | 6 | [rewrite] 7 | ^https://v2ex\.com/(t|\?tab) url script-response-body v2ex.js 8 | 9 | [mitm] 10 | v2ex.com 11 | 12 | ******** 13 | * 工具: tamperJS BY @elecV2 14 | * 频道: https://t.me/elecV2 15 | **/ 16 | 17 | let body = $response.body 18 | 19 | if (/<\/head>/.test(body)) { 20 | body = body.replace('', ``) 28 | 29 | // console.log('添加 tamperJS:v2ex.js') 30 | } 31 | 32 | $done({ body }) -------------------------------------------------------------------------------- /shortcuts/readme.md: -------------------------------------------------------------------------------- 1 | # 一些捷径 2 | 3 | 适用于 iOS Shortcuts 4 | 更新频道: https://t.me/elecV2 5 | 6 | ## JS 直链下载 - 自定义JS直链下载列表,可选择下载全部(默认)或挑选部分进行下载 7 | 8 | 链接: https://www.icloud.com/shortcuts/50d7d8576dd74f7685811502ff72c078 9 | 10 | 说明: 11 | 12 | - 下载文件保存在 iCoud Drive/shortcuts/elecV2JS文件夹(每次运行都会清空旧的文件) 13 | - 下载完成后,需手动复制一下文件到相关软件的对应目录 14 | - 理论上可以下载任何文本文件(.conf/.list/.md等) 15 | 16 | ## tamperJS - 配合 MITM 软件,在任意网页中使用 tampermonkey 脚本 17 | 18 | *iOS15 后 safari 浏览器已实现原生支持,此捷径没有再使用的必要* 19 | 20 | 链接: https://www.icloud.com/shortcuts/7a21b797d6c34a59a3978683dabc6298 21 | 22 | ## 京东 23 | 24 | - 京东活动列表 https://www.icloud.com/shortcuts/31878ea1e268423ca9bd8d46a1bf26d1 25 | - 通过京东 APP 打开某个链接: https://www.icloud.com/shortcuts/0cc89f3de2e349eb993d7f28a21603e6 -------------------------------------------------------------------------------- /betterweb/stackoverflow.snippet: -------------------------------------------------------------------------------- 1 | // stackoverflow 网页显示优化 2 | // 更新频道: https://t.me/elecV2 3 | // QuanX 重写订阅地址:https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/stackoverflow.snippet 4 | 5 | hostname = stackoverflow.com, *.stackexchange.com, superuser.com, serverfault.com 6 | 7 | // 本地测试 8 | // ^https://stackoverflow|superuser\.com/question url script-response-body stackoverflow.js 9 | 10 | // 注入 CSS 进行优化 11 | ^https://stackoverflow|superuser|serverfault\.com/question url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/stackoverflow.js 12 | 13 | ^https://.+\.stackexchange\.com/question url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/stackoverflow.js -------------------------------------------------------------------------------- /betterweb/smzdm.conf: -------------------------------------------------------------------------------- 1 | // SMZDM 手机网页显示优化 2 | // 规则仅对手机网页版有效,如使用APP 请勿添加 3 | // QuantumultX rewrite 订阅地址: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/smzdm.conf 4 | 5 | hostname = post.smzdm.com, post.m.smzdm.com 6 | 7 | // post.m.smzdm.com 重定向及更改到桌面版 User-Agent 8 | ^https:\/\/post\.m\.smzdm\.com url 307 https://post.smzdm.com 9 | ^https:\/\/post\.smzdm\.com\/ url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36$2 10 | 11 | // 再注入 CSS 进行优化 12 | ^https:\/\/post\.smzdm\.com\/ url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/smzdm.res.js 13 | 14 | // 更新频道: https://t.me/elecV2 -------------------------------------------------------------------------------- /betterweb/readme.md: -------------------------------------------------------------------------------- 1 | ### 网页显示优化 2 | 3 | 该系列脚本主要用于优化一些网页在手机浏览器上面的显示,及免(屏蔽)跳转 APP或应用商店,如正在使用相关应用的 APP 请勿添加。 4 | (只用 QuantumultX 进行了测试,其他软件理论上也可以使用,不过格式可能需要调整一下) 5 | 6 | 更新频道: https://t.me/elecV2 7 | 8 | 目前包含: 9 | 10 | - 知乎网页优化 QuanX rewrite 订阅: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihu.conf 11 | - 百度网盘页面优化 订阅: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/baiduPan.conf 12 | - CSDN 博客优化 订阅: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.conf 13 | - SMZDM 网页显示优化: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/smzdm.conf 14 | - stackoveflow 网页显示优化: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/stackoverflow.snippet 15 | 16 | - 谷歌移除搜索结果的重定向(*这个放在其他文件夹*) 订阅: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/rewriteG.conf -------------------------------------------------------------------------------- /google/google_noredirect.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 用于去除谷歌搜索结果的重定向 3 | * 更新频道:https://t.me/elecV2 4 | * 5 | * QuanX 重写订阅:https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/rewriteG.conf 6 | * 7 | * 或者手动添加: 8 | * [rewrite] 9 | * ^https://www\.google\.com/url\? url script-echo-response https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/google_noredirect.js 10 | * 11 | * [mitm host] 12 | * www.google.com 13 | **/ 14 | 15 | if (typeof $request !== 'undefined') { 16 | const urlorg = $request.url 17 | let urlnew = urlorg.match(/url=([^&]+)/) 18 | if (urlnew) { 19 | // console.log(JSON.stringify(urlnew)) 20 | $done({ 21 | status: 'HTTP/1.1 307 Temporary Redirect', 22 | headers: { "Location": decodeURIComponent(urlnew[1]) } 23 | }) 24 | } else { 25 | $done({}) 26 | } 27 | } else { 28 | console.log('脚本用于重写(rewrite) 网络请求,请勿直接运行该脚本\n问题反馈: https://t.me/elecV2') 29 | typeof $done !== 'undefined' && $done() 30 | } -------------------------------------------------------------------------------- /betterweb/csdn.conf: -------------------------------------------------------------------------------- 1 | // CSDN 手机网页显示优化 2 | // 规则仅对手机网页版有效,如使用APP 请勿添加 3 | // QuantumultX rewrite 订阅地址: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.conf 4 | 5 | hostname = blog.csdn.net, *.openinstall.io 6 | 7 | // 拦截CSDN登入提示(可能,来源网友提供 8 | ^https:\/\/blog\.csdn\.net\/sw\.js$ url reject 9 | 10 | // 先重写到桌面版 11 | ^https:\/\/blog\.csdn\.net\/ url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36$2 12 | 13 | // 再注入 CSS 进行优化 14 | ^https:\/\/blog\.csdn\.net\/.*\/article\/details url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.res.js 15 | 16 | // 免跳转应用商店(也可以直接 filter 屏蔽 openinstall.io) *重写到桌面版后,这条规则基本就没什么用了* 17 | ^https:\/\/wvhzpj\.openinstall\.io\/ulink url script-echo-response https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.req.js 18 | 19 | // 更新频道: https://t.me/elecV2 -------------------------------------------------------------------------------- /google/rewriteG.conf: -------------------------------------------------------------------------------- 1 | // google 相关重写(部分已失效 2 | // 作者:TG @elecV2 3 | // 订阅链接: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/rewriteG.conf 4 | 5 | hostname = www.google.com, www.google.cn, www.g.cn 6 | 7 | // google.cn 重定向 8 | ^https?:\/\/(www.)?(g|google)\.cn url 307 https://www.google.com 9 | 10 | // 屏蔽一些 ping 请求 11 | // https://www\.google\.com/client_204 url reject-200 12 | // https://www\.google\.com/ads url reject-dict 13 | 14 | // 去除 url 中的其他参数(在自动加载下一页是有问题,手机用户请勿添加 15 | // https://www\.google\.com/(m|search)\? url script-request-header https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/simplifyurl.js 16 | 17 | // google 去除搜索结果重定向 no redirect 18 | // ^https://www\.google\.com/url.+url=(https?)%3A%2F%2F([^%]+)%2F([^&]+) 19 | ^https://www\.google\.com/url\? url script-echo-response https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/google_noredirect.js 20 | 21 | // 自动翻页(Google 新版已自动加载,故注释掉。如有需要,自行开启 22 | // https:\/\/www\.google\.com\/(m|search) url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/Endless_Google.user.js -------------------------------------------------------------------------------- /betterweb/zhihu.conf: -------------------------------------------------------------------------------- 1 | // 知乎手机网页优化。(如使用 APP 请勿添加本规则) 2 | // 更新频道: https://t.me/elecV2 3 | // QuanX 重写订阅地址:https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihu.conf 4 | 5 | hostname = oia.zhihu.com, link.zhihu.com, www.zhihu.com 6 | 7 | // 先重写到桌面版 8 | ^https:\/\/www\.zhihu\.com\/(question|topic) url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36$2 9 | 10 | // 再注入 CSS 进行优化 11 | ^https:\/\/www\.zhihu\.com\/question url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihux.user.js 12 | ^https:\/\/www\.zhihu\.com\/topic url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihux.user.js 13 | 14 | // 去掉知乎跳转第三方网站的中间页面 15 | ^https?:\/\/link\.zhihu\.com/\?target=(https?)%3A//(.*) url 307 $1://$2 16 | 17 | // 不跳转应用商店 18 | ^https:\/\/oia\.zhihu\.com\/answers\/([0-9]+)\?.* url 307 https://www.zhihu.com/answer/$1 19 | ^https:\/\/oia\.zhihu\.com\/articles\/([0-9]+)\?.* url 307 https://zhuanlan.zhihu.com/p/$1 -------------------------------------------------------------------------------- /google/simplifyurl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * simplifyurl - 移除 Google 搜索 url 中多余的参数 3 | * 说明:在自动加载下一页时有问题,待修复 4 | **************** 5 | 6 | [rewrite] 7 | // 以下两种方式任选其一 8 | https://www\.google\.com/(m|search)\? url script-request-header https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/simplifyurl.js 9 | 10 | // 307 重定向,无需 JS。缺点是不能翻页、无法查看图片/视频等其他搜索项 11 | // https:\/\/www\.google\.com\/(m|search).+(q=[^&]+)&.+ url 307 $1?$2 12 | 13 | [mitm] 14 | hostname = www.google.com 15 | 16 | ******** 17 | * 作者: TG@elecV2 18 | **/ 19 | 20 | if (typeof $request === 'undefined') { 21 | console.log('脚本用于重写(rewrite) 网络请求,请勿直接运行该脚本\n问题反馈: https://t.me/elecV2') 22 | typeof $done !== 'undefined' && $done() 23 | } 24 | 25 | const url = $request.url 26 | if (!url.match(/\?/)) { 27 | $done({}) 28 | } 29 | 30 | const qs = { 31 | google: ['q', 'location', 'uule', 'hl', 'nfpr', 'filter', 'tbm', 'tbs', 'start', 'num', 'lr', 'ijn', 'nirf', 'safe'] 32 | } 33 | 34 | let urlb = new URL(url); 35 | 36 | const skey = []; 37 | qs.google.forEach(key=>{ 38 | const v = urlb.searchParams.get(key); 39 | if (v) { 40 | skey.push(`${key}=${v}`); 41 | } 42 | }); 43 | if ([...urlb.searchParams].length !== skey.length) { 44 | const path = urlb.pathname + '?' + encodeURI(skey.join('&')); 45 | console.log(`${url} redirectPath to ${path}`); 46 | $done({ path }); 47 | } else { 48 | $done({}); 49 | } -------------------------------------------------------------------------------- /tgbotmessage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 功能:使用TG bot 给频道或他人发信息 3 | * 使用方法: 4 | * 先使用 https://t.me/BotFather 创建一个机器人,获取 bot token 5 | * 然后获取目标用户的 chatid,填写到下面对应位置。然后start bot 6 | * 7 | * 如果要发送到频道,先将机器人拉到频道并给予管理员权限 8 | * 9 | * cron 8 8 8 * * * tgbotmessage.js 10 | * 11 | */ 12 | 13 | 14 | const CONFIG = { 15 | chatid: '8xxxxxxxxxxxxx', // 接受信息的用户 id 16 | token: 'xxxxxxxxxxxxxxxxxx' // tg bot token 17 | } 18 | 19 | let message = `[必应随机壁纸](https://bing.ioliu.cn/v1/rand?${Date.now()})` // api 来源: https://github.com/xCss/bing 20 | 21 | const payload = { 22 | "method": "sendMessage", 23 | "chat_id": CONFIG.chatid, 24 | "parse_mode": "markdown", 25 | "disable_web_page_preview": false, 26 | "text": 'hello elecV2!' 27 | } 28 | 29 | payload.text = message 30 | 31 | const myRequest = { 32 | url: `https://api.telegram.org/bot${CONFIG.token}/`, 33 | method: 'POST', 34 | headers: { 35 | 'Content-Type': 'application/json' 36 | }, 37 | body: JSON.stringify(payload) 38 | } 39 | 40 | $task.fetch(myRequest).then(res => { 41 | try { 42 | let body = JSON.parse(res.body) 43 | if (body.ok) { 44 | let result = body.result 45 | console.log('send', result.chat.username, result.chat.first_name, result.chat.last_name, 'message:', result.text) 46 | } else { 47 | console.log(body) 48 | } 49 | } catch { 50 | console.log(res.body) 51 | } 52 | }, error => { 53 | console.log(error) 54 | }) -------------------------------------------------------------------------------- /betterweb/jianshu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称:jianshu.js 3 | * 作者:elecV2 4 | * 5 | ******** Quantumult X conf ******** 6 | // 规则仅对手机网页版有效,如使用APP 请勿添加 7 | 8 | // rewrite 远程订阅地址:https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/jianshu.conf 9 | 10 | ---------- jianshu.conf ------------------ 11 | hostname = www.jianshu.com 12 | 13 | // 先重写到桌面版 14 | ^https:\/\/www\.jianshu\.com\/p url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36$2 15 | // 再注入 CSS 进行优化 16 | ^https:\/\/www\.jianshu\.com\/p url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/jianshu.js 17 | ------------- 18 | 19 | ******** 20 | * 频道: https://t.me/elecV2 21 | **/ 22 | 23 | let body = $response.body 24 | 25 | if (/<\/html>|<\/body>/.test(body)) { 26 | body = body.replace('', ``) 29 | 30 | console.log('添加 tamperJS:jianshu.js') 31 | } 32 | 33 | $done({ body }) -------------------------------------------------------------------------------- /betterweb/csdn.req.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称: csdn.req.js 3 | * 作用: blog.csdn.net 免跳转应用商店 4 | * 5 | ******** QuantumultX conf ******** 6 | // 规则仅对手机网页版有效,如使用APP 请勿添加 7 | // QuantumultX rewrite 订阅地址: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.conf 8 | 9 | hostname = blog.csdn.net, *.openinstall.io 10 | 11 | // 先重写到桌面版 12 | ^https:\/\/blog\.csdn\.net\/ url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36$2 13 | 14 | // 再注入 CSS 进行优化 15 | ^https:\/\/blog\.csdn\.net\/.*\/article\/details url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.res.js 16 | 17 | // 免跳转应用商店(也可以直接 filter 屏蔽 openinstall.io) 18 | ^https:\/\/wvhzpj\.openinstall\.io\/ulink url script-echo-response https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.req.js 19 | 20 | ******** 21 | * 更新频道: https://t.me/elecV2 22 | **/ 23 | 24 | if (typeof $request !== 'undefined') { 25 | let url = $request.url 26 | let b64 = url.split('/').pop() 27 | let obj = atob(b64) 28 | 29 | obj = JSON.parse(obj) 30 | 31 | $done({ 32 | status: "HTTP/1.1 307 Temporary Redirect", 33 | headers: { "Location": obj.d.url }, 34 | }) 35 | } else { 36 | console.log('csdn.req.js 用于 rewrite 重写规则,请勿直接运行\nBY: https://t.me/elecV2') 37 | $done() 38 | } -------------------------------------------------------------------------------- /tamperJSLog.js: -------------------------------------------------------------------------------- 1 | // tamperJS 日志输出。在网页上显示 console.log/error 的内容。 2 | // 双击展开/收缩,三击清空日志 3 | document.body.insertAdjacentHTML("beforeend",``); 4 | const tamperJSLog = document.querySelector("#tamperJSLog"); 5 | tamperJSLog.addEventListener('click', (evt) => { 6 | if (evt.detail === 3) { 7 | document.querySelectorAll('#tamperJSLog li').forEach(e=>e.remove()) 8 | } 9 | }) 10 | const elecV2 = console; 11 | window.console = { 12 | ...elecV2, 13 | log:(...e)=>{ 14 | e=e.map(e=>"string"!=typeof e?JSON.stringify(e):e).join(" ") 15 | tamperJSLog.insertAdjacentHTML("afterbegin","
  • "+e+"
  • ") 16 | elecV2.log(e) 17 | }, 18 | error:(...e)=>{ 19 | e=e.map(e=>"string"!=typeof e?JSON.stringify(e):e).join(" ") 20 | tamperJSLog.insertAdjacentHTML("afterbegin",'
  • error: '+e+"
  • ") 21 | elecV2.error(e) 22 | } 23 | }; -------------------------------------------------------------------------------- /nodeToSub/nodeToSub.js: -------------------------------------------------------------------------------- 1 | async function handleRequest(data) { 2 | const init = { 3 | headers: { 4 | 'content-type': 'text/plain;charset=UTF-8', 5 | }, 6 | } 7 | return new Response(data, init) 8 | } 9 | 10 | addEventListener('fetch', event => { 11 | let url = event.request.url 12 | let nodes = url.match(/(?<=nd=)([^&]+)/g) 13 | 14 | if (/quanx/.test(url)) { 15 | nodes = nodes.map(node=>{ 16 | // if(/^ss/.test(node)) return true 17 | let isV2n = /^vmess/.test(node) && isJson(atob(node.split("://")[1])) 18 | return isV2n ? v2ntoquanx(node) : node 19 | }) 20 | } 21 | let base64 = btoa(nodes.join("\n")) 22 | return event.respondWith(handleRequest(base64)) 23 | }) 24 | 25 | function isJson(str){ 26 | try { 27 | JSON.parse(str) 28 | return true 29 | } catch { 30 | return false 31 | } 32 | } 33 | 34 | function v2ntoquanx(vmess, method="chacha20-poly1305", tag=null) { 35 | // 只支持 v2rayN 格式的链接转换 36 | // method 可选: chacha20-poly1305 aes-128-gcm none 37 | let quanxv2 = "vmess=" 38 | let v2data = atob(vmess.split("://")[1]) 39 | let elecV2 = isJson(v2data) ? JSON.parse(v2data) : '' 40 | if (!elecV2 || elecV2.net == "kcp") { 41 | console.log("quanx 暂时不支持 kcp 协议") 42 | return false 43 | } 44 | let obfs = "" 45 | if (elecV2.net == "tcp" && elecV2.tls == "tls") { 46 | obfs += `obfs=over-tls,` 47 | } else if (elecV2.net == "ws") { 48 | if (elecV2.tls == "tls") obfs += `obfs=wss,` 49 | else obfs += `obfs=ws,` 50 | } 51 | quanxv2 += `${elecV2.add}:${elecV2.port}, method=${ method || elecV2.method }, password=${elecV2.id}, ${obfs} fast-open=false, udp-relay=false, tag=${tag || elecV2.ps || elecV2.name || "vmess"}` 52 | 53 | return quanxv2 54 | } -------------------------------------------------------------------------------- /nodeToSub/Readme.md: -------------------------------------------------------------------------------- 1 | # 功能 2 | 3 | 将单(多)个节点转换成订阅。 4 | 5 | 节点传输使用的是 GET 模式,传输数据量有限,建议在少量节点转换时使用。 6 | 7 | 使用 GET 的优点是,节点信息不必保存在服务器上,增加安全性,以及减少服务器的压力。缺点是传输信息较少,如果是 vmess 链接的话可能只能转换1-2个。 8 | 9 | # 实现 10 | 11 | 使用了 cloudflare workers。 12 | 13 | 注册/登录 cloudflare,新建一个 worker。 14 | 15 | ![workers.png](https://i.loli.net/2020/03/23/rB5qfHFiRIb73jd.png) 16 | 17 | 保存之后,一个节点转换订阅的服务器就搭建好了,可以看到该服务器的域名,类似: https://xxxxx.xxxx.workers.dev 18 | 19 | 然后拷贝 **getShow.js** 或者 **nodeToSub.js** 文件中的所有代码到指定位置即可 20 | 21 | 22 | ## 两个版本的代码区别 23 | 24 | 实例节点:*vmess://eyJwcyI6Indzc2tpdCIsImFkZCI6InVuaS5raXRzdW5lYmkuZnVuIiwicG9ydCI6IjU2NjYiLCJ2IjoiMiIsImlkIjoiOTUxMzc4NTctNzBmYS00YWM4LThmOTAtNGUyMGFlYjY2MmNmIiwiYWlkIjoiMCIsIm5ldCI6IndzIiwidHlwZSI6Im5vbmUiLCJob3N0IjoiIiwicGF0aCI6Ii92MiIsInRscyI6InRscyJ9* 25 | 26 | ### 简易版: **getShow.js** (建议使用) 27 | 28 | 节点信息通过GET(?bstr=)传递:https://服务器域名/?bstr=所有节点信息 29 | 返回的数据为**bstr**后面的所有原始参数。 30 | 31 | - 实例(注意替换域名为实际服务器地址) 32 | 33 | 则订阅链接为:https://服务器域名/?bstr=dm1lc3M6Ly9leUp3Y3lJNkluZHpjMnRwZENJc0ltRmtaQ0k2SW5WdWFTNXJhWFJ6ZFc1bFlta3VablZ1SWl3aWNHOXlkQ0k2SWpVMk5qWWlMQ0oySWpvaU1pSXNJbWxrSWpvaU9UVXhNemM0TlRjdE56Qm1ZUzAwWVdNNExUaG1PVEF0TkdVeU1HRmxZalkyTW1ObUlpd2lZV2xrSWpvaU1DSXNJbTVsZENJNkluZHpJaXdpZEhsd1pTSTZJbTV2Ym1VaUxDSm9iM04wSWpvaUlpd2ljR0YwYUNJNklpOTJNaUlzSW5Sc2N5STZJblJzY3lKOQ== 34 | 35 | 36 | ### 复杂版: **nodeToSub.js** 37 | 38 | 节点信息通过 GET 参数传递,最终的订阅链接格式为: https://服务器域名/?nd=节点。 39 | 多个节点: https://服务器域名/?nd=节点1&nd=节点2&nd=节点3 40 | 41 | 如果要把普通 v2rayN 格式的 vmess 节点转换为 QuanX 可用格式,在域名后面添加 **quanx** 即可,类似: https://服务器域名/quanx?nd=节点1&nd=节点2&nd=节点3 42 | 43 | #### 实例 44 | - 直接转换 45 | 46 | 则订阅链接为: https://服务器域名/?nd=vmess://eyJwcyI6Indzc2tpdCIsImFkZCI6InVuaS5raXRzdW5lYmkuZnVuIiwicG9ydCI6IjU2NjYiLCJ2IjoiMiIsImlkIjoiOTUxMzc4NTctNzBmYS00YWM4LThmOTAtNGUyMGFlYjY2MmNmIiwiYWlkIjoiMCIsIm5ldCI6IndzIiwidHlwZSI6Im5vbmUiLCJob3N0IjoiIiwicGF0aCI6Ii92MiIsInRscyI6InRscyJ9 47 | 48 | - 转换为 QuanX 可用格式 49 | 50 | 则订阅链接为: https://服务器域名/quanx?nd=vmess://eyJwcyI6Indzc2tpdCIsImFkZCI6InVuaS5raXRzdW5lYmkuZnVuIiwicG9ydCI6IjU2NjYiLCJ2IjoiMiIsImlkIjoiOTUxMzc4NTctNzBmYS00YWM4LThmOTAtNGUyMGFlYjY2MmNmIiwiYWlkIjoiMCIsIm5ldCI6IndzIiwidHlwZSI6Im5vbmUiLCJob3N0IjoiIiwicGF0aCI6Ii92MiIsInRscyI6InRscyJ9 -------------------------------------------------------------------------------- /cookieshow.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称:cookieshow.js 3 | * 功能:显示任意网页的cookie。(网页 cookie 和实际向服务器发送请求的 cookie 可能有所不同) 4 | * 5 | * 制作:elecV2 6 | * 7 | ******** 以下为 tamperJS 自动生成的 rewrite 相关信息,可能需要根据情况适当调整 ******** 8 | 9 | // bean.m.jd.com 可以更换为任意其他域名,比如 baidu.com, www.google.com 等 10 | [rewrite] 11 | https:\/\/bean\.m\.jd\.com\/ url script-response-body cookieshow.js 12 | 13 | [mitm] 14 | , bean.m.jd.com 15 | 16 | ******** 17 | * 工具: tamperJS BY @elecV2 18 | * 频道: https://t.me/elecV2 19 | * 20 | **/ 21 | 22 | let body = $response.body 23 | 24 | if (/<\/html>|<\/body>/.test(body)) { 25 | body = body.replace('', ` 26 | `) 55 | 56 | console.log('添加 tamperJS:cookieshow.js') 57 | } 58 | 59 | $done({ body }) -------------------------------------------------------------------------------- /betterweb/baiduPan.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称:baiduPan.js 3 | * 说明:百度网盘手机网页优化 4 | * 5 | ******** (已修改) 以下为 tamperJS 自动生成的 rewrite 相关信息,可能需要根据情况适当调整 ******** 6 | QuanX rewrite 复写一键订阅: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/baiduPan.conf 7 | 8 | 或者手动添加: 9 | [rewrite] 10 | ^https:\/\/pan\.baidu\.com url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36$2 11 | 12 | ^https:\/\/pan\.baidu\.com url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/baiduPan.js 13 | 14 | [mitm] 15 | pan.baidu.com 16 | 17 | ******** 18 | * 工具: tamperJS BY @elecV2 19 | * 频道: https://t.me/elecV2 20 | **/ 21 | 22 | let body = $response.body 23 | 24 | if (/<\/html>|<\/body>/.test(body)) { 25 | body = body.replace('', ``) 28 | 29 | console.log('添加 tamperJS:baiduPan.js') 30 | } 31 | 32 | $done({ body }) -------------------------------------------------------------------------------- /betterweb/stackoverflow.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称: stackoverflow.js 3 | * 说明: stackoverflow 网页显示优化 4 | * 制作: https://t.me/elecV2 5 | * 更新: 2022-08-22 19:56 6 | ********** 7 | [rewrite] 8 | // 重写规则订阅: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/stackoverflow.snippet 9 | 10 | // 或者手动添加: 11 | ^https://stackoverflow|superuser|serverfault\.com/question url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/stackoverflow.js 12 | 13 | ^https://.+\.stackexchange\.com/question url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/stackoverflow.js 14 | 15 | [mitm] 16 | stackoverflow.com, *.stackexchange.com, superuser.com, serverfault.com 17 | 18 | * 备注: 19 | * - 理论上适用于所有 stackexchange 模板网站 https://stackexchange.com/sites 20 | * - 该脚本也支持在 tampermonkey/userscripts 等浏览器插件中使用 21 | **/ 22 | 23 | const css_for_stackoverflow = '.pl8,#left-sidebar,#sidebar,#js-gdpr-consent-banner,.bs-sm,.ws4, .js-consent-banner,.ml12,.post-taglist,.js-post-menu,.postcell .mt24,.-flair span:not(.reputation-score),.ai-end,.v2cele,.gs8>.mr16,.gsx>.d-flex,.js-dismissable-hero,.site-header,.js-new-contributor-indicator,#announcement-banner{display: none !important}#content {padding: 3px 6px !important;border: none !important;}#mainbar{width: 100% !important}.votecell.post-layout--left {position: absolute;right: 1em;padding-right: 0px !important;opacity: .6;}.post-layout--left:hover {opacity: 1;}.user-info {display: flex;padding-bottom: 0 !important;}.user-action-time {min-width: 272px;white-space: nowrap;z-index: 0;margin-top: 4px !important;}.relativetime {font-size: 22px;color: #FAFAFD;}.comments.js-comments-container,.postcell .mb16,.answercell .mt24,.post-layout--right,.gs8.gsy,.js-top-bar{margin: 0 !important;padding: 0 !important;}.js-top-bar{padding-right: 1em !important;}.post-layout {border: 1px solid #003153;border-radius: 6px;overflow: hidden;}.js-post-body {padding: 6px;}.post-signature.flex--item {width: 380px;max-width: 100%;height: 42px;background: #003153;border-radius: 0px;margin-bottom: 0 !important;}.comment-actions {width: 22px !important;}.comment-score {width: 22px !important;padding-right: 0 !important;text-align: right;}.gs8{justify-content: space-around !important;}.user-details{white-space: nowrap;text-overflow: ellipsis;overflow: hidden;}.new-login-form {max-width: 100%;margin: 0;}pre code {white-space: pre-wrap;}' 24 | 25 | if (typeof $response !== 'undefined') { 26 | let body = $response.body 27 | 28 | if (/<\/head>/.test(body)) { 29 | body = body.replace(/<\/head>/, ``) 30 | 31 | // console.log('添加 tamperJS: stackoverflow.js') 32 | } 33 | $done({ body }) 34 | } else if (typeof document !== 'undefined') { 35 | let domstyle = document.createElement('style') 36 | domstyle.innerHTML = css_for_stackoverflow 37 | document.head.appendChild(domstyle) 38 | } else { 39 | console.log('stackoverflow.js 用于重写(rewrite) 网络请求,或者在浏览器插件中使用,请勿直接运行该脚本\n问题反馈: https://t.me/elecV2') 40 | typeof $done !== 'undefined' && $done() 41 | } -------------------------------------------------------------------------------- /betterweb/csdn.res.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称: csdn.res.js 3 | * 作用: blog.csdn.net 手机网页优化 4 | * 5 | ******** QuantumultX conf ******** 6 | // 规则仅对手机网页版有效,如使用APP 请勿添加 7 | // QuantumultX rewrite 订阅地址: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.conf 8 | 9 | hostname = blog.csdn.net, *.openinstall.io 10 | 11 | // 先重写到桌面版 12 | ^https:\/\/blog\.csdn\.net\/ url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36$2 13 | 14 | // 再注入 CSS 进行优化 15 | ^https:\/\/blog\.csdn\.net\/.*\/article\/details url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.res.js 16 | 17 | // 免跳转应用商店(也可以直接 filter 屏蔽 openinstall.io) 18 | ^https:\/\/wvhzpj\.openinstall\.io\/ulink url script-echo-response https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/csdn.req.js 19 | 20 | ******** 21 | * 频道: https://t.me/elecV2 22 | **/ 23 | 24 | if (typeof $response !== 'undefined') { 25 | let body = $response.body 26 | 27 | if (/<\/html>|<\/body>/.test(body)) { 28 | const cookieMod = { 29 | get(key){ 30 | if (typeof $store !== "undefined") return $store.get(key) 31 | if (typeof $prefs !== "undefined") return $prefs.valueForKey(key) 32 | if (typeof $persistentStore !== "undefined") return $persistentStore.read(key) 33 | if (typeof localStorage !== "undefined") return localStorage.getItem(key) 34 | } 35 | } 36 | 37 | let config = { 38 | recommendblock: cookieMod.get('csdn_recommend_block') === 'false' ? false : true, // 是否屏蔽推荐文章。默认 true: 屏蔽 39 | logshow: cookieMod.get('csdn_log_show') === 'false' ? false : true, // 是否显示 JS 注入成功的 log。默认 true: 显示 40 | } 41 | 42 | body = body.replace('', ``) 43 | 44 | if (config.logshow) { 45 | console.log('CSDN 手机网页优化') 46 | } 47 | } 48 | $done({ body }) 49 | } else { 50 | console.log('csdn.res.js 用于 rewrite 重写规则,请勿直接运行\nBY: https://t.me/elecV2') 51 | $done() 52 | } -------------------------------------------------------------------------------- /betterweb/smzdm.res.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称: smzdm.res.js 3 | * 作用: SMZDM 手机网页优化 4 | * 5 | ******** QuantumultX conf ******** 6 | // 规则仅对手机网页版有效,如使用APP 请勿添加 7 | // QuantumultX rewrite 订阅地址: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/smzdm.conf 8 | 9 | hostname = post.smzdm.com, post.m.smzdm.com 10 | 11 | // post.m.smzdm.com 重定向及更改到桌面版 User-Agent 12 | ^https:\/\/post\.m\.smzdm\.com url 307 https://post.smzdm.com 13 | ^https:\/\/post\.smzdm\.com\/ url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36$2 14 | 15 | // 再注入 CSS 进行优化 16 | ^https:\/\/post\.smzdm\.com\/ url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/smzdm.res.js 17 | 18 | ******** 19 | * 频道: https://t.me/elecV2 20 | **/ 21 | 22 | if (typeof $response !== 'undefined') { 23 | let body = $response.body 24 | 25 | if (/<\/html>|<\/body>/.test(body)) { 26 | const cookieMod = { 27 | get(key){ 28 | if (typeof $store !== "undefined") return $store.get(key) 29 | if (typeof $prefs !== "undefined") return $prefs.valueForKey(key) 30 | if (typeof $persistentStore !== "undefined") return $persistentStore.read(key) 31 | if (typeof localStorage !== "undefined") return localStorage.getItem(key) 32 | } 33 | } 34 | 35 | let config = { 36 | logshow: cookieMod.get('smzdm_log_show') === 'false' ? false : true, // 是否显示 JS 注入成功的 log。默认 true: 显示 37 | } 38 | 39 | body = body.replace('', ``) 40 | 41 | if (config.logshow) { 42 | console.log('smzdm 手机网页优化') 43 | } 44 | } 45 | $done({ body }) 46 | } else { 47 | console.log('smzdm.res.js 用于 rewrite 重写规则,请勿直接运行\nBY: https://t.me/elecV2') 48 | $done() 49 | } -------------------------------------------------------------------------------- /betterweb/zhihux.user.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称: zhihux.user.js 3 | * 参考: https://userstyles.org/styles/userjs/167694/zhihux.user.js 4 | * 5 | * 制作: https://t.me/elecV2 6 | ********** 7 | [rewrite] 8 | // 以下规则仅对手机网页版有效,如使用APP 请勿添加 9 | // 一键订阅: https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihu.conf 10 | 11 | // 手动添加: 12 | // 先重写到桌面版 13 | ^https:\/\/www\.zhihu\.com\/ url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36$2 14 | // 再注入 CSS 进行优化 15 | ^https:\/\/www\.zhihu\.com\/question url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihux.user.js 16 | ^https:\/\/www\.zhihu\.com\/topic url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/zhihux.user.js 17 | 18 | // 去掉知乎跳转第三方网站的中间页面。可选,记得加 mitmhost: link.zhihu.com 19 | ^https?://link\.zhihu\.com/\?target=(https?)%3A//(.*) url 307 $1://$2 20 | 21 | // 可选。知乎专栏底部推荐阅读文章直接打开,免跳转应用商店。mitmhost: oia.zhihu.com 22 | ^https:\/\/oia\.zhihu\.com\/answers\/([0-9]+)\?.* url 307 https://www.zhihu.com/answer/$1 23 | ^https:\/\/oia\.zhihu\.com\/articles\/([0-9]+)\?.* url 307 https://zhuanlan.zhihu.com/p/$1 24 | 25 | [mitm] 26 | www.zhihu.com 27 | **/ 28 | 29 | if (typeof $response !== 'undefined') { 30 | let body = $response.body 31 | 32 | if (/<\/html>|<\/body>/.test(body)) { 33 | body = body.replace('', ``) 34 | 35 | console.log('添加 tamperJS: zhihux.user.js') 36 | } 37 | $done({ body }) 38 | } else { 39 | console.log('zhihux.user.js 用于重写 rewrite 规则,请勿直接运行该脚本\nBY: https://t.me/elecV2') 40 | $done() 41 | } -------------------------------------------------------------------------------- /google/Endless_Google.user.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称:Endless_Google.user.js 3 | * 地址:https://openuserjs.org/install/tumpio/Endless_Google.user.js 4 | * 5 | * 制作:elecV2 6 | * 7 | ******** (已调整)以下为 tamperJS 自动生成的 rewrite 相关信息,可能需要根据情况适当调整 ******** 8 | 9 | [rewrite] 10 | https:\/\/www\.google\.com\/(m|search) url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/google/Endless_Google.user.js 11 | 12 | [mitm] 13 | hostname = www.google.com 14 | 15 | ******** 16 | * 工具: tamperJS BY @elecV2 17 | * 频道: https://t.me/elecV2 18 | * 19 | **/ 20 | 21 | let body = $response.body 22 | 23 | if (/<\/html>|<\/body>/.test(body)) { 24 | body = body.replace('', ` 25 | 26 | `) 173 | 174 | console.log('添加 tamperJS:Endless_Google.user.js') 175 | } 176 | 177 | $done({ body }) -------------------------------------------------------------------------------- /betterweb/baidu.user.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 名称:baidu.user.js 3 | * 源址:https://userstyles.org/styles/userjs/178663/pure.user.js 4 | * 5 | * 制作:elecV2(自用测试) 6 | * 7 | ******** 以下为 tamperJS 自动生成的 rewrite 相关信息,可能需要根据情况适当调整 ******** 8 | 9 | [rewrite] 10 | ^https?:\/\/.*\.baidu\.com url script-response-body https://raw.githubusercontent.com/elecV2/QuantumultX-Tools/master/betterweb/baidu.user.js 11 | 12 | // 可选 13 | ^https?:\/\/.*\.baidu\.com url request-header (\r\n)User-Agent:.+(\r\n) request-header $1User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/16C50 Quark/604.1 T7/10.3 SearchCraft/2.6.3 (Baidu; P1 8.0.0)$2 14 | 15 | [mitm] 16 | *.baidu.com 17 | 18 | ******** 19 | * 工具: tamperJS BY @elecV2 20 | * 频道: https://t.me/elecV2 21 | * 22 | **/ 23 | 24 | let body = $response.body 25 | 26 | if (/<\/html>|<\/body>/.test(body)) { 27 | body = body.replace('', ` 28 | 29 | `) 1044 | 1045 | console.log('添加 tamperJS:baidu.user.js') 1046 | } 1047 | 1048 | $done({ body }) --------------------------------------------------------------------------------