├── .eslintrc ├── .gitignore ├── AnnoyancesInterception.md ├── AnnoyancesInterception.user.js ├── AutoDarkMode.md ├── AutoDarkMode.user.js ├── AutoUnfold.md ├── AutoUnfold.user.js ├── DoubanAssistant.md ├── DoubanAssistant.user.js ├── GptCleaner.user.js ├── JenkinsAssistant.user.js ├── LICENSE ├── LinkManager.md ├── LinkManager.user.js ├── NetdiskAssistant.user.js ├── README.md ├── RemoveSuffix.md └── RemoveSuffix.user.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true, 5 | "greasemonkey": true 6 | }, 7 | "extends": "eslint:recommended", 8 | "parserOptions": { 9 | "ecmaVersion": 6, 10 | "sourceType": "module" 11 | }, 12 | "rules": { 13 | "no-unused-vars":"warn", 14 | "no-inner-declarations":"off" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Changelog* 2 | WebSite* -------------------------------------------------------------------------------- /AnnoyancesInterception.md: -------------------------------------------------------------------------------- 1 | [![GitHub license](https://img.shields.io/github/license/airbashX/UserScript.svg?style=flat-square&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 2 | [![GitHub Star](https://img.shields.io/github/stars/airbashX/UserScript.svg?style=flat-square&label=Star&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 3 | [![GitHub Fork](https://img.shields.io/github/forks/airbashX/UserScript.svg?style=flat-square&label=Fork&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 4 | [![](https://data.jsdelivr.com/v1/package/gh/airbashX/UserScript/badge)](https://www.jsdelivr.com/package/gh/airbashX/UserScript) 5 | [![](https://img.shields.io/static/v1?label=%20&message=GreasyFork&style=flat-square&labelColor=7B0000&color=960000&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII=)](https://greasyfork.org/zh-CN/users/698573-厌学的骚年) 6 | 7 | # 相关功能: 8 | 9 | 骚扰拦截:PC+手机全平台通用; 10 | 11 | 拦截或删除`app打开弹窗`、`下载弹窗`、`悬浮按钮`、`小程序`、`登录提示`等影响用户体验的骚扰元素 12 | 13 | 本脚本不拦截广告,广告拦截的话请订阅[easylist-china](https://easylist-downloads.adblockplus.org/easylistchina.txt)广告过滤规则 14 | 15 | # 相关脚本: 16 | | 名称 | 功能 | 17 | | :----------- | :----------------------------------------------------------- | 18 | | **[自动展开](https://greasyfork.org/zh-CN/scripts/438656)** | 自动展开文章或新闻等`隐藏`、`折叠`部分 | 19 | | **[骚扰拦截](https://greasyfork.org/zh-CN/scripts/440871)** | 自动拦截`下载弹窗`、`悬浮按钮`、`登录弹窗`等影响用户体验的骚扰元素 | 20 | | **[链接管理](https://greasyfork.org/zh-CN/scripts/443670)** | 取消点击链接后跳转到安全页面 | 21 | | **[移除复制后缀](https://greasyfork.org/zh-CN/scripts/472307)** | 移除复制后附带的`后缀`、`网站声明` | 22 | 23 | # 适配网站: 24 | |网站名|PC|Phone|app弹窗|悬浮按钮|其他功能| 25 | |-|-|-|-|-|-| 26 | |CSDN|✔|✔|✔|✔|去除登录提示+学生认证| 27 | |掘金|✔|✔|✔|✔|去除登录提示| 28 | |简书|✔|✔|✔|✔|去除登录提示| 29 | |知乎|✔|✔|✔|✔|去除登录提示| 30 | |知乎专栏|✔|✔|✔|✔|去除登录提示| 31 | |百度贴吧|✔|✔|✔|✔|| 32 | |百度文库|✔|✔|✔|✔|| 33 | |百家号|✔|✔|✔|✔|| 34 | |百家资讯|✔|✔|✔|✔|| 35 | |百度新闻|✔|✔|✔|✔|| 36 | |新浪新闻|✔|✔|✔|✔|| 37 | |搜狐新闻|✔|✔|✔|✔|| 38 | |腾讯视频|✔|✔|✔|✔|| 39 | |优酷视频|✔|✔|✔|✔|| 40 | |爱奇艺|✔|✔|✔|✔|去除登录提示| 41 | |好看视频|✔|✔|✔|✔|去除登录提示+播放暂停时下载App提示| 42 | |m1905电影网|✔|✔|✔|✔|| 43 | |百度搜索|✔|✔|✔|✔|去除搜索结果中的:小程序+百度手机助手| 44 | |必应搜索|✔|✔|✔|✔|去除搜索结果中的:下载必应APP| 45 | |哔哩哔哩|✔|✔|✔|✔|去除登录提示| 46 | |西瓜视频|✔|✔|✔|✔|去除登录提示| 47 | |B站专栏|✔|✔|✔|✔|去除登录提示| 48 | |B站笔记|✔|✔|✔|✔|去除登录提示| 49 | |丁香园|✔|✔|✔|✔|| 50 | |健康界|✔|✔|✔|✔|| 51 | |微博|✔|✔|✔|✔|| 52 | |新浪财经|✔|✔|✔|✔|| 53 | |东方财富网|✔|✔|✔|✔|| 54 | |抖音|✔|✔|✔|✔|去除登录提示,去除登陆后查看评论| 55 | |电子发烧友|✔|✔|✔|✔|| 56 | |人民网|✔|✔|✔|✔|| 57 | |新京报|✔|✔|✔|✔|| 58 | |观察者网|✔|✔|✔|✔|| 59 | |澎湃新闻|✔|✔|✔|✔|| 60 | |凤凰新闻|✔|✔|✔|✔|| 61 | |网易新闻|✔|✔|✔|✔|| 62 | |今日头条|✔|✔|✔|✔|| 63 | |东方资讯|✔|✔|✔|✔|| 64 | |虎嗅|✔|✔|✔|✔|| 65 | |虎扑|✔|✔|✔|✔|| 66 | |豆瓣|✔|✔|✔|✔|| 67 | |中关村在线|✔|✔|✔|✔|| 68 | |太平洋电脑|✔|✔|✔|✔|| 69 | |太平洋汽车网|✔|✔|✔|✔|| 70 | |汽车之家|✔|✔|✔|✔|去除登录提示| 71 | |taptap|✔|✔|✔|✔|| 72 | |it之家|✔|✔|✔|✔|| 73 | |360doc|✔|✔|✔|✔|去除登录提示| 74 | |开源中国|✔|✔|✔|✔|| 75 | |segmentfault|✔|✔|✔|✔|去除登录提示| 76 | |W3CSchool|✔|✔|✔|✔|去除登录提示| 77 | |阿里云开发者社区|✔|✔|✔|✔|| 78 | |腾讯云开发者社区|✔|✔|✔|✔|| 79 | |华为云开发者社区|✔|✔|✔|✔|| 80 | |36氪|✔|✔|✔|✔|| 81 | |雪球|✔|✔|✔|✔|去除登录提示| 82 | |天眼查|✔|✔|✔|✔|| 83 | |站酷|✔|✔|✔|✔|去除登录提示| 84 | |小红书|✔|✔|✔|✔|去除登录提示| 85 | |喜马拉雅|✔|✔|✔|✔|| 86 | |中国知网|✔|✔|✔|✔|| 87 | |装备在线|✔|✔|✔|✔|| 88 | |什么值得买|✔|✔|✔|✔|| 89 | 持续支持中... -------------------------------------------------------------------------------- /AnnoyancesInterception.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 骚扰拦截 3 | // @version 1.4.18 4 | // @namespace airbash/AnnoyancesInterception 5 | // @homepageURL https://github.com/AirBashX/UserScript 6 | // @author airbash 7 | // @description 手机、电脑全平台通用:自动拦截或删除`下载弹窗`、`悬浮按钮`等影响用户体验的元素;长期维护:CSDN、简书、知乎、知乎专栏、百度搜索、百家号、百度贴吧、百度文库、百度新闻、新浪新闻、腾讯视频、优酷视频、爱奇艺、好看视频、哔哩哔哩、B站专栏、B站笔记、西瓜视频、抖音、丁香园、健康界、微博、新浪财经、东方财富网、电子发烧友、人民网、新京报、观察者网、澎湃新闻、凤凰新闻、网易新闻、今日头条、东方资讯、虎嗅、虎扑、豆瓣、中关村在线、太平洋电脑、太平洋汽车网、汽车之家、太平洋汽车网、taptap、it之家、360doc、开源中国、segmentfault、W3CSchool、阿里云开发者社区、腾讯云开发者社区、华为云开发者社区、36氪、雪球、天眼查、站酷、小红书、中国知网、装备前线、必应搜索、什么值得买 8 | // @match *://*.csdn.net/* 9 | // @match *://*.jianshu.com/* 10 | // @match *://juejin.cn/* 11 | // @match *://*.zhihu.com/* 12 | // @match *://tieba.baidu.com/* 13 | // @match *://baijiahao.baidu.com/s* 14 | // @match *://mbd.baidu.com/newspage/data/* 15 | // @match *://news.baidu.com/news* 16 | // @match *://m.baidu.com/sf_baijiahao/* 17 | // @match *://view.inews.qq.com/* 18 | // @match *://xw.qq.com/* 19 | // @match *://m.sohu.com/a/* 20 | // @match *://m.v.qq.com/* 21 | // @match *://*.youku.com/* 22 | // @match *://*.iqiyi.com/* 23 | // @match *://haokan.baidu.com/* 24 | // @match *://*.1905.com/* 25 | // @match *://*.baidu.com/* 26 | // @match *://*.bilibili.com/* 27 | // @match *://3g.dxy.cn/* 28 | // @match *://www.cn-healthcare.com/* 29 | // @match *://*.sina.cn/* 30 | // @match *://m.weibo.cn/* 31 | // @match *://wap.eastmoney.com/* 32 | // @match *://mguba.eastmoney.com/* 33 | // @match *://*.ixigua.com/* 34 | // @match *://www.douyin.com/* 35 | // @match *://m.elecfans.com/* 36 | // @match *://app.people.cn/* 37 | // @match *://m.bjnews.com.cn/detail/* 38 | // @match *://*.guancha.cn/* 39 | // @match *://m.thepaper.cn/newsDetail_forward* 40 | // @match *://*.ifeng.com/* 41 | // @match *://m.163.com/* 42 | // @match *://3g.163.com/* 43 | // @match *://m.toutiao.com/* 44 | // @match *://www.toutiao.com/* 45 | // @match *://mini.eastday.com/nsa/* 46 | // @match *://m.huxiu.com/* 47 | // @match *://m.hupu.com/* 48 | // @match *://m.douban.com/* 49 | // @match *://g.pconline.com.cn/* 50 | // @match *://m.zol.com.cn/* 51 | // @match *://wap.zol.com.cn/* 52 | // @match *://www.autohome.com.cn/* 53 | // @match *://*.m.autohome.com.cn/* 54 | // @match *://m.autohome.com.cn/* 55 | // @match *://m.pcauto.com.cn/* 56 | // @match *://www.taptap.cn/* 57 | // @match *://m.taptap.cn/* 58 | // @match *://m.ithome.com/* 59 | // @match *://www.360doc.com/content/* 60 | // @match *://www.oschina.net/* 61 | // @match *://developer.aliyun.com/article/* 62 | // @match *://huaweicloud.csdn.net/* 63 | // @match *://m.36kr.com/p/* 64 | // @match *://xueqiu.com/* 65 | // @match *://segmentfault.com/q/* 66 | // @match *://www.w3cschool.cn/* 67 | // @match *://m.tianyancha.com/* 68 | // @match *://*.zcool.com.cn/* 69 | // @match *://m.ximalaya.com/* 70 | // @match *://www.xiaohongshu.com/* 71 | // @match *://wap.cnki.net/* 72 | // @match *://www.zfrontier.com/* 73 | // @match *://*.m.smzdm.com/* 74 | // @icon data:image/png;base64,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 75 | // @run-at document-body 76 | // @grant none 77 | // @license GPL-3.0 78 | // ==/UserScript== 79 | 80 | (function () { 81 | "use strict"; 82 | 83 | /** 84 | * 规则列表 85 | * @type {name/url/items} 86 | */ 87 | const websites = [ 88 | { 89 | name: "CSDN", 90 | url: "csdn.net", 91 | items: [ 92 | //下载弹窗 93 | ".weixin-shadowbox", 94 | //悬浮按钮:打开:狐猴浏览器中的bug 95 | ".feed-Sign-weixin", 96 | //悬浮按钮:APP内打开+登录/打开注册(主页) 97 | ".feed-Sign-span", 98 | //PC端:弹窗:学生认证 99 | "#csdn-highschool-window", 100 | //PC端:登录弹窗(顶部) 101 | "#csdn-toolbar-profile-nologin", 102 | //PC端:登录弹窗(底部) 103 | ".passport-login-tip-container", 104 | ], 105 | fun: function () { 106 | /** 107 | * PC端:屏蔽登录弹窗 108 | * @param {list} mutationsList The mutations list 109 | */ 110 | let removeLoginNotice = function (mutationsList) { 111 | for (let mutation of mutationsList) { 112 | for (let node of mutation.addedNodes) { 113 | if (document.querySelector(".passport-login-container")) { 114 | //有登陆弹窗时:模拟点击关闭按钮 115 | let button = node.querySelector("img"); 116 | if (button) { 117 | if (LoginFlag == true) { 118 | button.click(); 119 | } else { 120 | LoginFlag = true; 121 | } 122 | return; 123 | } 124 | } 125 | } 126 | } 127 | }; 128 | 129 | let loginBtn = document.querySelector(".toolbar-btn-login>.toolbar-btn-loginfun"); 130 | //未登录: 131 | if (loginBtn) { 132 | //添加事件,不拦截 133 | loginBtn.addEventListener("click", function () { 134 | LoginFlag = false; 135 | }); 136 | //执行监听 137 | let observer = new MutationObserver(removeLoginNotice); 138 | observer.observe(document, { childList: true, subtree: true }); 139 | } 140 | //移动版登录弹窗 141 | if (document.querySelector(".toolbarBack")) { 142 | addStyle(".passport-login-container {display: none !important}"); 143 | } 144 | }, 145 | }, 146 | { 147 | name: "简书", 148 | url: "jianshu.com", 149 | items: [ 150 | //下载弹窗 151 | ".download-app-guidance", 152 | //悬浮按钮:打开App,看更多相似好文 153 | ".call-app-btn", 154 | //悬浮按钮:打开App,看更多好文(首页) 155 | ".index_call-app-btn", 156 | //PC端:透明遮挡 157 | "._23ISFX-mask", 158 | //PC端:登录弹窗 159 | "._23ISFX-wrap", 160 | ], 161 | overflow: true, 162 | }, 163 | { 164 | name: "掘金", 165 | url: "juejin.cn", 166 | items: [ 167 | //悬浮按钮:APP内打开 168 | ".open-button", 169 | //下载弹窗 170 | ".app-open-drawer", 171 | //PC端:下方拓展弹窗(主页) 172 | ".recommend-box", 173 | //PC端:登录弹窗(右上角) 174 | ".login-popover", 175 | //PC端:登录弹窗(右下角) 176 | ".bottom-login-guide", 177 | ], 178 | overflow: true, 179 | }, 180 | { 181 | name: "知乎发现页", 182 | url: "www.zhihu.com/explore", 183 | items: [ 184 | //PC端:登录按钮(发现页) 185 | ".ExploreHomePage-specialsLogin", 186 | ], 187 | fun: function () { 188 | //发现页:热点和问题高度保持一致; 189 | if (location.href.includes("www.zhihu.com/explore")) { 190 | addStyle(".ExploreHomePage-square > div:nth-child(3){margin: 0px}"); 191 | } 192 | }, 193 | }, 194 | { 195 | name: "知乎", 196 | url: "zhihu.com", 197 | items: [ 198 | //悬浮按钮:是否在知乎app内阅读全文 199 | ".MobileModal-wrapper", 200 | //悬浮按钮:打开知乎(主页),打开 201 | ".OpenInAppButton", 202 | ], 203 | overflow: true, 204 | fun: function () { 205 | //PC端拦截登录弹窗 206 | if (!/Mobile|Android|iPhone/i.test(navigator.userAgent)) { 207 | window.addEventListener("DOMContentLoaded", function () { 208 | let loginBtn = document.querySelector(".css-1rwz7is"); 209 | //检验是否登录 210 | if (loginBtn) { 211 | //执行监听 212 | let observer = new MutationObserver(removeLoginNotice); 213 | observer.observe(document, { childList: true, subtree: true }); 214 | 215 | onload = function () { 216 | loginBtn.addEventListener("click", function () { 217 | LoginFlag = false; 218 | }); 219 | }; 220 | } 221 | }); 222 | /** 223 | * 删除登录弹窗 224 | * 225 | * @param {MutationRecord[]} mutationsList The mutations list 226 | * @param {MutationObserver} observer The observer 227 | */ 228 | function removeLoginNotice(mutationsList) { 229 | for (let mutation of mutationsList) { 230 | for (let node of mutation.addedNodes) { 231 | //有登陆弹窗1时:模拟点击关闭按钮 232 | if (node.querySelector(".signFlowModal")) { 233 | let button = node.querySelector(".Button.Modal-closeButton.Button--plain"); 234 | if (button) { 235 | if (LoginFlag == true) { 236 | button.click(); 237 | } else { 238 | LoginFlag = true; 239 | } 240 | return; 241 | } 242 | } 243 | //拦截登录弹窗2 244 | if (getXpath('//button[text()="立即登录/注册"]', node)) { 245 | getXpath('//button[text()="立即登录/注册"]', node).parentElement.parentElement.remove(); 246 | } 247 | } 248 | } 249 | } 250 | } 251 | }, 252 | }, 253 | { 254 | name: "百度", 255 | url: "baidu.com", 256 | items: [ 257 | //悬浮按钮:打开百度 258 | "#J-invoke-baiduApp-float", 259 | ], 260 | }, 261 | { 262 | name: "百度贴吧", 263 | url: "tieba.baidu.com", 264 | items: [ 265 | //悬浮按钮:打开百度贴吧 266 | ".nav-bar-bottom", 267 | ], 268 | }, 269 | { 270 | name: "百度文库1", 271 | url: "/wk.baidu.com/view/", 272 | items: [ 273 | //悬浮按钮(上方):百度文库 274 | ".wk-student-defense", 275 | ], 276 | }, 277 | { 278 | name: "百度文库2", 279 | url: "tanbi.baidu.com/h5apptopic/browse/", 280 | items: [ 281 | //悬浮按钮(上方):百度文库 282 | ".wk-student-limit-jump", 283 | ".bartop", 284 | //悬浮按钮(下方):下载App,继续阅读 285 | ".wk-bottom-btn", 286 | ], 287 | }, 288 | { 289 | name: "百家号", 290 | url: "baijiahao.baidu.com/s", 291 | items: [ 292 | //悬浮按钮:百度APP内打开 293 | "#bdrainrwDragButton", 294 | ], 295 | }, 296 | { 297 | name: "百度资讯+百度首页", 298 | url: "mbd.baidu.com/newspage/data", 299 | items: [ 300 | //悬浮按钮:百度APP内打开 301 | "#bdrainrwDragButton", 302 | //悬浮按钮:百度APP内播放 303 | ".drag-bottom", 304 | ], 305 | }, 306 | { 307 | name: "腾讯新闻1", 308 | url: "view.inews.qq.com/", 309 | items: [ 310 | //固定按钮:打开 311 | ".slider-top-bar_sliderWrapper__1Nize", 312 | //悬浮按钮:打开腾讯新闻,看更多热点资讯 313 | ".bottom-bar_buttonWrap__NXBe-", 314 | ], 315 | }, 316 | { 317 | name: "腾讯新闻2", 318 | url: "xw.qq.com/", 319 | items: [ 320 | //固定按钮:打开(首页) 321 | "#opeApp", 322 | ], 323 | }, 324 | { 325 | name: "腾讯视频", 326 | url: "m.v.qq.com", 327 | items: [ 328 | //下载弹窗 329 | ".at-app-banner", 330 | //打开APP查看高清内容 331 | ".open_app_bottom", 332 | ], 333 | }, 334 | { 335 | name: "优酷视频", 336 | url: "youku.com", 337 | items: [ 338 | //下载弹窗 339 | ".callEnd_box", 340 | //悬浮按钮(主页):打开优酷APP更流畅 341 | ".callEnd_fixed_box", 342 | //悬浮按钮:打开优酷APP更流畅 343 | ".undefined", 344 | //悬浮按钮:红包 345 | ".Corner-container", 346 | ], 347 | }, 348 | { 349 | name: "爱奇艺", 350 | url: "iqiyi.com/", 351 | items: [ 352 | //下载弹窗 353 | ".m-iqyGuide-layer", 354 | //打开爱奇艺APP,看精彩视频 355 | "[class^=ChannelHomeBanner]", 356 | //PC端:登录提示上侧 357 | ".pl__1", 358 | ], 359 | }, 360 | { 361 | name: "好看视频", 362 | url: "haokan.baidu.com/", 363 | items: [ 364 | //悬浮按钮:打开好看app(中间) 365 | ".open-app-top", 366 | //固定文字:打开APP(多) 367 | ".top-video-card-img-app", 368 | //固定按钮:下载APP(视频播放时) 369 | ".video-player-download-tips", 370 | //固定按钮:打开(底部) 371 | ".open-app-bottom", 372 | //固定按钮:打开(底部:个别) 373 | ".NewOpenApp", 374 | //PC端固定按钮:下载APP(视频暂停时) 375 | ".player-lefttip-inner", 376 | //PC端登录提示:登录提示 377 | "#passport-login-pop", 378 | //PC端登录提示:朦胧背板 379 | ".pop-mask", 380 | //PC端登录提示:悬浮提示 381 | ".page-top-rightinfo-popover", 382 | ], 383 | }, 384 | { 385 | name: "m1905电影网", 386 | url: "1905.com/", 387 | items: [ 388 | //悬浮弹窗:打开app 389 | "#popupModule", 390 | //悬浮按钮: 391 | ".open-link", 392 | ], 393 | }, 394 | { 395 | name: "百度搜索", 396 | url: "baidu.com", 397 | items: [ 398 | //搜索结果:小程序 399 | "[srcid=xcx_multi]", 400 | //搜索结果:百度手机助手 401 | "[srcid=app_mobile_simple]", 402 | //搜索结果:百度手机助手:安全下载 403 | "[srcid=app_mobile_simple_safety]", 404 | //搜索结果:百度应用搜索(IOS) 405 | "[srcid=app_mobile_ios]", 406 | ], 407 | }, 408 | { 409 | name: "哔哩哔哩", 410 | url: "bilibili.com", 411 | items: [ 412 | //悬浮按钮:打开app,看你感兴趣的内容(主页) 413 | ".m-open-app.fixed-openapp", 414 | //悬浮按钮:打开app(UP主页) 415 | ".m-space-float-openapp", 416 | //悬浮按钮:打开app,看高清内容(视频全屏) 417 | ".mplayer-widescreen-callapp", 418 | //悬浮按钮:bilibili内打开(底部) 419 | ".m-float-openapp", 420 | //悬浮弹窗:bilibili内打开 421 | ".openapp-dialog", 422 | //固定按钮:播放时下载 423 | ".mplayer-widescreen-callapp", 424 | //PC端:登录提示(右下角) 425 | ".lt-row", 426 | //PC端:登录提示(右上角) 427 | ".login-panel-popover:has(.login-tip-content)", 428 | //PC端:登录提示(播放器) 429 | ".bpx-player-toast-wrap", 430 | //PC端:登录提示(右上角) 431 | "div:has(.unlogin-popover-avatar)", 432 | //PC端:滑动提示(正下方:首次) 433 | ".trial-feed-wrap", 434 | ], 435 | fun: function () { 436 | let add; 437 | function mutationCallback(record, observer) { 438 | //已确定登录:停止监听 439 | let login = document.querySelector(".header-entry-mini"); 440 | if (login) { 441 | observer.disconnect(); 442 | } 443 | //已确定未登录:执行函数 444 | let loginBtn = document.querySelector(".header-login-entry"); 445 | if (loginBtn) { 446 | if (!add) { 447 | console.log("脚本注入成功"); 448 | //添加事件:不拦截 449 | loginBtn.addEventListener("click", function () { 450 | LoginFlag = false; 451 | }); 452 | add = true; 453 | } 454 | for (let arr of record) { 455 | for (let node of arr.addedNodes) { 456 | let button; 457 | try { 458 | button = node.querySelector(".bili-mini-close-icon"); 459 | } catch (error) { 460 | /* empty */ 461 | } 462 | if (button) { 463 | //有登陆弹窗时:模拟点击关闭按钮 464 | if (LoginFlag == true) { 465 | console.log(LoginFlag); 466 | console.log("自动拦截"); 467 | button.click(); 468 | 469 | console.log("恢复播放"); 470 | let video = document.querySelector(".bpx-player-video-wrap video"); 471 | video.play(); 472 | } else { 473 | console.log(LoginFlag); 474 | console.log("手动拦截"); 475 | LoginFlag = true; 476 | } 477 | return; 478 | } 479 | } 480 | } 481 | } 482 | } 483 | let observer = new MutationObserver(mutationCallback); 484 | observer.observe(document, { childList: true, subtree: true }); 485 | }, 486 | }, 487 | { 488 | name: "B站笔记", 489 | url: "bilibili.com/opus/", 490 | items: [ 491 | //PC端:登录提示 492 | "div:has(.unlogin-popover-avatar)", 493 | ], 494 | }, 495 | { 496 | name: "西瓜视频", 497 | url: "ixigua.com", 498 | items: [ 499 | //打开弹窗:打开 500 | ".landing_guide", 501 | //PC端:登录提示 502 | ".loginBenefitNotification", 503 | //悬浮按钮:打开西瓜视频,看全网超清视频 504 | ".xigua-download", 505 | ], 506 | }, 507 | { 508 | name: "抖音电脑版", 509 | url: "www.douyin.com", 510 | items: [ 511 | //PC端:下载电脑客户端 512 | "#douyin-web-download-guide-container", 513 | //PC端:右下角登录提示(画质) 514 | ".login-clarity-new", 515 | //PC端:登陆后查看评论 516 | "#related-video-card-login-guide", 517 | //PC端:底部登录提示 518 | ".wwNZW6za", 519 | ], 520 | fun: function () { 521 | //登陆后查看评论模糊 522 | addStyle("._61cgy6j3{filter: none !important}"); 523 | //拦截登录弹窗 524 | onload = function () { 525 | //增加点击事件 526 | let inter = setInterval(() => { 527 | let loginBtn = getXpath('//div[text()="登录"] | //p[text()="登录"]', document).parentElement; 528 | if (loginBtn) { 529 | loginBtn.addEventListener("click", function () { 530 | LoginFlag = false; 531 | }); 532 | clearInterval(inter); 533 | } 534 | }, 1000); 535 | }; 536 | 537 | /** 538 | * Removes a login notice. 539 | * 540 | * @param {MutationRecord[]} mutationsList The mutations list 541 | * @param {MutationObserver} observer The observer 542 | */ 543 | let removeLoginNotice = function (mutationsList) { 544 | for (let mutation of mutationsList) { 545 | for (let node of mutation.addedNodes) { 546 | if (node.nodeType == Node.ELEMENT_NODE) { 547 | let closeBtn = document.querySelector(".lR1QBof5"); 548 | //关闭登录弹窗 549 | if (closeBtn) { 550 | if (LoginFlag == true) { 551 | closeBtn.click(); 552 | } 553 | } 554 | return; 555 | } 556 | } 557 | } 558 | }; 559 | //执行监听 560 | let observer = new MutationObserver(removeLoginNotice); 561 | observer.observe(document, { childList: true, subtree: true }); 562 | }, 563 | }, 564 | { 565 | name: "丁香园", 566 | url: "3g.dxy.cn", 567 | items: [ 568 | //悬浮按钮:APP内打开 569 | "[class^=fixedBtn]", 570 | //悬浮按钮:App内打开(主页) 571 | ".wrap", 572 | ], 573 | }, 574 | { 575 | name: "健康界", 576 | url: "www.cn-healthcare.com/", 577 | items: [ 578 | //悬浮按钮:打开(底部滚动) 579 | "footer", 580 | ], 581 | }, 582 | { 583 | name: "微博", 584 | url: "m.weibo.cn", 585 | items: [ 586 | //悬浮按钮:在微博内打开(百度热议) 587 | ".app-btn-box", 588 | //悬浮按钮:登录/注册 589 | ".login-btn", 590 | //小程序 591 | ".wrap", 592 | ], 593 | }, 594 | { 595 | name: "新浪新闻", 596 | url: "sina.cn/", 597 | items: [ 598 | //悬浮按钮:打开APP 599 | ".callApp_fl_btn", 600 | ], 601 | }, 602 | { 603 | name: "新浪财经", 604 | url: "sina.cn/", 605 | items: [ 606 | //悬浮弹窗:立即更新(主页:首次访问) 607 | "#SFA_newVersion_pop", 608 | //悬浮按钮:打开App中查看(主页:底部) 609 | ".m-client-call2", 610 | //固定按钮:立即登录(主页:资讯) 611 | ".login-box", 612 | //悬浮按钮:立即查看(资讯:底部,首次访问) 613 | ".wap-msg-bar-wap", 614 | //悬浮按钮:去APP听语音播报(资讯:中间) 615 | ".broadcast", 616 | //悬浮按钮:打开APP(资讯:顶部,有bug) 617 | ".m-sentiment-blk", 618 | //悬浮按钮:打开APP(资讯:底部) 619 | ".m-guss-caijing", 620 | //固定按钮:立即体验(资讯:底部) 621 | "#norm_qrcode_link_auto", 622 | //悬浮按钮:打开APP(子栏1:底部) 623 | "#subPage_bottom_callup_btn", 624 | //悬浮按钮:打开APP(子栏2:底部) 625 | "#__callup_bottom_new", 626 | //悬浮按钮:打开APP(子栏2:顶部,有bug) 627 | ".js-app-header", 628 | //悬浮按钮:新版本抢先体验(底部) 629 | "#SNP_bottom_bar", 630 | ], 631 | fun: function () { 632 | //修复上述规则产生的bug 633 | let inter = setInterval(() => { 634 | let item = document.querySelector(".compatibility-mode"); 635 | if (item.style.marginTop == "0px") { 636 | clearInterval(inter); 637 | } else { 638 | item.style.marginTop = "0px"; 639 | } 640 | }, 1000); 641 | }, 642 | }, 643 | { 644 | name: "东方财富网", 645 | url: "wap.eastmoney.com/", 646 | items: [ 647 | //悬浮按钮:打开APP(顶部) 648 | ".fixed_top", 649 | //固定按钮:下载(主页:顶部) 650 | "#IndexDT", 651 | //悬浮按钮:打开下载(主页:顶部) 652 | ".emwapas_xldt_fixed", 653 | //悬浮按钮:打开APP(主页:底部) 654 | ".open-inapp", 655 | ], 656 | }, 657 | { 658 | name: "东方财富网:股吧", 659 | url: "mguba.eastmoney.com/", 660 | items: [ 661 | //悬浮弹窗:打开APP 662 | "#appbox", 663 | //悬浮按钮:东方财富APP内打开(底部) 664 | "#open_app", 665 | ], 666 | }, 667 | { 668 | name: "电子发烧友", 669 | url: "m.elecfans.com", 670 | items: [ 671 | //悬浮按钮:主页右侧 672 | ".hm_quick", 673 | //悬浮按钮:登陆/注册 674 | ".login-reg-fixed", 675 | //悬浮按钮:上方打开app 676 | ".open_app", 677 | ], 678 | }, 679 | { 680 | name: "人民网", 681 | url: "app.people.cn", 682 | items: [ 683 | //悬浮按钮:打开(底部) 684 | ".app-bot-wrap", 685 | ], 686 | }, 687 | { 688 | name: "新京报", 689 | url: "m.bjnews.com.cn/detail/", 690 | items: [ 691 | //悬浮按钮:立即打开(顶部) 692 | ".xjb-top", 693 | ], 694 | }, 695 | { 696 | name: "观察者网", 697 | url: "guancha.cn", 698 | items: [ 699 | //固定按钮:点击下载(顶部) 700 | ".g_header44", 701 | //悬浮按钮:APP专享(底部) 702 | ".g_swiper_container", 703 | ], 704 | }, 705 | { 706 | name: "澎湃新闻", 707 | url: "m.thepaper.cn/newsDetail_forward", 708 | items: [ 709 | //悬浮按钮:新闻滚条(底部) 710 | "[class^=index_footer_banner]", 711 | "[.index_footer_banner__Mcr_R]", 712 | ], 713 | }, 714 | { 715 | name: "凤凰新闻", 716 | url: "ifeng.com", 717 | items: [ 718 | //悬浮按钮:立即打开(主页) 719 | "[class^=index_fixSlide_]", 720 | //悬浮按钮:滚动新闻(新闻底部) 721 | "[class^=index_bottom_box_]", 722 | //悬浮按钮:立即打开(财经底部) 723 | "[class^=index_bottomSlide_]", 724 | //悬浮按钮:滚动新闻(卫视底部) 725 | "[class^=index_fixBottom_]", 726 | ], 727 | }, 728 | { 729 | name: "网易新闻", 730 | url: "3g.163.com", 731 | items: [ 732 | //固定按钮:App内打开(底部) 733 | ".backflow-floating", 734 | ], 735 | }, 736 | { 737 | name: "网易新闻", 738 | url: "m.163.com", 739 | items: [ 740 | //固定按钮:App内打开(底部) 741 | ".backflow-floating", 742 | ], 743 | }, 744 | { 745 | name: "搜狐新闻", 746 | url: "m.sohu.com/a/", 747 | items: [ 748 | //悬浮按钮:打开APP 749 | "#CallAppContainer", 750 | ".CallAppContainer", 751 | ], 752 | }, 753 | { 754 | name: "今日头条:移动端", 755 | url: "m.toutiao.com/", 756 | items: [ 757 | //悬浮按钮:App内打开(底部) 758 | ".m-bottom-container", 759 | //悬浮按钮:去首页(文章) 760 | ".m-index-tag", 761 | ], 762 | }, 763 | { 764 | name: "今日头条:PC端", 765 | url: "www.toutiao.com/", 766 | items: [ 767 | //悬浮弹窗:添加今日头条到电脑桌面 768 | ".add-panel", 769 | //悬浮弹窗:扫码下载今日头条 770 | "download-panel", 771 | ], 772 | }, 773 | { 774 | name: "东方资讯", 775 | url: "mini.eastday.com/nsa/", 776 | items: [ 777 | //PC端:悬浮弹窗:添加到桌面 778 | "#dftt-message-wrapper", 779 | ], 780 | }, 781 | { 782 | name: "虎嗅", 783 | url: "m.huxiu.com", 784 | items: [ 785 | //悬浮按钮:go!(主页) 786 | ".guide-wrap", 787 | //悬浮按钮:打开(顶部) 788 | ".js-top-fixed", 789 | //悬浮按钮:打开(底部) 790 | ".bottom-open-app-btn", 791 | ], 792 | }, 793 | { 794 | name: "虎扑", 795 | url: "m.hupu.com", 796 | items: [ 797 | //悬浮按钮:App内打开 798 | ".open-hupu", 799 | ], 800 | }, 801 | { 802 | name: "豆瓣", 803 | url: "m.douban.com", 804 | items: [ 805 | //固定按钮:用App打开(电影详情页) 806 | ".subject-banner", 807 | //悬浮按钮:豆瓣APP内打开 808 | ".talion-nav-footer", 809 | ], 810 | }, 811 | { 812 | name: "太平洋电脑", 813 | url: "g.pconline.com.cn", 814 | items: [ 815 | //悬浮按钮:打开app(底部) 816 | ".btnForAppOpenImg", 817 | //悬浮按钮:打开知科技App 818 | ".btnForAppOpenA", 819 | //固定按钮:立即打开(底部) 820 | ".WakeUptop", 821 | //悬浮按钮:打开(底部) 822 | ".page-float-box", 823 | ], 824 | }, 825 | { 826 | name: "中关村在线", 827 | url: "m.zol.com.cn", 828 | items: [ 829 | //悬浮按钮:打开APP 830 | ".cover-back_s", 831 | //悬浮按钮:APP内打开 832 | "#bottom-fixed-wrapper > span", 833 | ], 834 | }, 835 | { 836 | name: "中关村在线2(报价+论坛)", 837 | url: "wap.zol.com.cn", 838 | items: [ 839 | //悬浮按钮:打开APP 840 | ".cover-back_s", 841 | //悬浮按钮:APP内打开 842 | "#bottom-fixed-wrapper > span", 843 | ], 844 | }, 845 | { 846 | name: "汽车之家PC版", 847 | url: "www.autohome.com.cn", 848 | items: [ 849 | //悬浮按钮:登录提示(PC端) 850 | "#loginGuide", 851 | ], 852 | }, 853 | { 854 | name: "汽车之家移动版", 855 | url: "m.autohome.com.cn", 856 | items: [ 857 | //悬浮按钮: App内打开 858 | "#float_new_button", 859 | ], 860 | }, 861 | { 862 | name: "太平洋汽车", 863 | url: "m.pcauto.com.cn/", 864 | items: [ 865 | //悬浮弹窗: App内打开 866 | "#home-bottom-half-dialog", 867 | //悬浮按钮: 轮播评论 868 | "#dmListOuter", 869 | ], 870 | }, 871 | { 872 | //www.taptap.com 873 | name: "taptap", 874 | url: "www.taptap.cn", 875 | items: [ 876 | //悬浮按钮:打开taptap 877 | ".open-app-global-float", 878 | ], 879 | }, 880 | { 881 | //m.taptap.com 882 | name: "taptap", 883 | url: "m.taptap.cn", 884 | items: [ 885 | //悬浮按钮:打开taptap查看更多精彩内容 886 | ".app-download__wrapper", 887 | //苹果端:悬浮按钮:添加到桌面 888 | ".show-add-to-screen", 889 | //苹果端:固定按钮:添加到桌面 890 | ".add-to-screen-wrap", 891 | ], 892 | }, 893 | { 894 | //https://m.ithome.com/ 895 | name: "it之家", 896 | url: "m.ithome.com", 897 | items: [ 898 | //固定按钮(底部):立即打开 899 | ".open-app-banner", 900 | ], 901 | }, 902 | { 903 | name: "360docPC版", 904 | url: "www.360doc.com/content/", 905 | items: [ 906 | //登录弹窗 907 | "iframe", 908 | //登录弹窗:朦胧模板 909 | "iframe~div", 910 | ], 911 | }, 912 | { 913 | name: "开源中国", 914 | url: "www.oschina.net", 915 | items: [ 916 | //悬浮按钮(底部):立即打开 917 | ".app-download-banner-box", 918 | ], 919 | }, 920 | { 921 | name: "segmentfault思否", 922 | url: "segmentfault.com/q", 923 | items: [ 924 | //登录弹窗 925 | ".modal-dialog-centered", 926 | ], 927 | }, 928 | { 929 | name: "阿里云开发者社区", 930 | url: "developer.aliyun.com/article/", 931 | items: [ 932 | //阿里云App内打开 933 | ".app-fixed-btn", 934 | ], 935 | }, 936 | { 937 | name: "华为云开发者社区", 938 | url: "huaweicloud.csdn.net/", 939 | items: [ 940 | //加入社区 941 | ".user-desc-fix", 942 | ], 943 | }, 944 | { 945 | //https://m.36kr.com/p/1964588951470856 946 | name: "36氪", 947 | url: "m.36kr.com/p/", 948 | items: [ 949 | //悬浮按钮(顶部):打开 950 | ".article-top-swiper-goapp", 951 | ], 952 | }, 953 | { 954 | name: "雪球", 955 | url: "xueqiu.com/", 956 | items: [ 957 | //悬浮按钮:加群学习(主页) 958 | ".FloatDownloadButton_mobile_xiaoxue-button_1jZ", 959 | //悬浮按钮:加群学习(文章) 960 | ".index_xiaoxue-button_1Av", 961 | //悬浮按钮:登录提示 962 | ".widget__download-app", 963 | ], 964 | fun: function () { 965 | //悬浮按钮:打开app(话题) 966 | document.onreadystatechange = function () { 967 | if (document.readyState === "complete") { 968 | document.querySelector("[class^=FloatDownloadButton_mobile_openapp__fix_]").remove(); 969 | } 970 | }; 971 | 972 | /** 973 | * Removes a login notice. 974 | * 975 | * @param {MutationRecord[]} mutationsList The mutations list 976 | * @param {MutationObserver} observer The observer 977 | */ 978 | let removeLoginNotice = function (mutationsList) { 979 | for (let mutation of mutationsList) { 980 | for (let node of mutation.addedNodes) { 981 | let closeBtn = document.querySelector(".modal__login .close"); 982 | //关闭登录弹窗 983 | if (LoginFlag == true) { 984 | closeBtn.click(); 985 | } else { 986 | LoginFlag == true; 987 | } 988 | return; 989 | } 990 | } 991 | }; 992 | //拦截登录弹窗 993 | document.addEventListener("DOMContentLoaded", function () { 994 | let loginBtn = document.querySelector(".loginBtn"); 995 | //检验是否登录 996 | if (loginBtn.textContent === "登录") { 997 | //增加点击事件 998 | loginBtn.addEventListener("click", function () { 999 | LoginFlag = false; 1000 | //未知bug:导致第一次点击无法生效,所以这里再点击一次 1001 | loginBtn.click(); 1002 | }); 1003 | } 1004 | //执行监听 1005 | let observer = new MutationObserver(removeLoginNotice); 1006 | observer.observe(document, { childList: true, subtree: true }); 1007 | }); 1008 | }, 1009 | }, 1010 | { 1011 | name: "天眼查", 1012 | url: "m.tianyancha.com/", 1013 | items: [ 1014 | //悬浮按钮:打开app(主页) 1015 | ".swiper-container", 1016 | //悬浮按钮:下载APP(企业) 1017 | "#banner_mobile_v2", 1018 | ], 1019 | }, 1020 | { 1021 | name: "站酷移动版", 1022 | url: "m.zcool.com.cn/", 1023 | items: [ 1024 | //悬浮按钮:打开app(主页) 1025 | ".bottom-App", 1026 | //悬浮按钮:打开app 1027 | "[class^=wapHeader_footer-button]", 1028 | ], 1029 | }, 1030 | { 1031 | name: "站酷PC版", 1032 | url: "www.zcool.com.cn/", 1033 | items: [ 1034 | //登录按钮 1035 | ".sideUnlogin", 1036 | //登录弹窗 1037 | ".ReactModal__Overlay--after-open:not(.ReactModal__Overlay_content-page)", 1038 | ], 1039 | fun: function () { 1040 | //登录弹窗导致的页面无法滑动 1041 | addStyle("html,body {overscroll-behavior: unset !important;overflow: unset !important;}"); 1042 | }, 1043 | }, 1044 | { 1045 | name: "小红书", 1046 | url: "www.xiaohongshu.com", 1047 | items: [ 1048 | //App内打开(视频) 1049 | ".bottom-button-box", 1050 | //App内打开(笔记) 1051 | ".bottom-bar", 1052 | ], 1053 | fun: function () { 1054 | let mo = new MutationObserver(function (mutations) { 1055 | for (let mutation of mutations) { 1056 | for (let node of mutation.addedNodes) { 1057 | let button = node.querySelector(".icon-btn-wrapper"); 1058 | if (button) { 1059 | if (LoginFlag) { 1060 | button.click(); 1061 | } else { 1062 | LoginFlag = true; 1063 | } 1064 | return; 1065 | } 1066 | } 1067 | } 1068 | }); 1069 | let loginBtn = document.querySelector(".login-btn"); 1070 | if (loginBtn) { 1071 | loginBtn.addEventListener( 1072 | "click", 1073 | function () { 1074 | LoginFlag = false; 1075 | }, 1076 | true, 1077 | ); 1078 | mo.observe(document, { childList: true, subtree: true }); 1079 | } 1080 | }, 1081 | }, 1082 | { 1083 | name: "喜马拉雅", 1084 | url: "m.ximalaya.com/", 1085 | items: [ 1086 | //悬浮按钮:打开APP,完整收听1 1087 | ".album-btn-container", 1088 | //悬浮按钮:打开APP,完整收听2 1089 | ".btn-open", 1090 | //打开APP2 1091 | ".downloadButton", 1092 | ], 1093 | }, 1094 | { 1095 | //https://wap.cnki.net/touch/web/Journal/Article/WLAQ202302061.html 1096 | name: "中国知网", 1097 | url: "wap.cnki.net/", 1098 | items: [ 1099 | //App内打开 1100 | ".Appopen", 1101 | //滚动新闻 1102 | "#fix-bottom", 1103 | ], 1104 | }, 1105 | { 1106 | name: "zfrontier", 1107 | url: "www.zfrontier.com", 1108 | items: [ 1109 | //App内打开 1110 | ".app-opener", 1111 | ], 1112 | }, 1113 | { 1114 | name: "必应搜索", 1115 | url: "bing.com", 1116 | items: [ 1117 | //必应中打开(Chrome中专属) 1118 | ".bnp_rich_div_visible", 1119 | ], 1120 | }, 1121 | { 1122 | name: "w3cschool", 1123 | url: "www.w3cschool.cn/", 1124 | items: [], 1125 | fun: function () { 1126 | //复制文件时的弹窗 1127 | onload = function () { 1128 | let mo = new MutationObserver(function (mutations) { 1129 | for (let mutation of mutations) { 1130 | for (let node of mutation.addedNodes) { 1131 | if (node.nodeName == "DIV" && node.className == "") { 1132 | node.style.display = "none"; 1133 | } 1134 | } 1135 | } 1136 | }); 1137 | mo.observe(document, { childList: true, subtree: true }); 1138 | }; 1139 | }, 1140 | }, 1141 | { 1142 | name: "什么值得买", 1143 | url: "m.smzdm.com/", 1144 | items: [ 1145 | //app内打开 1146 | ".footer-banner-wrap", 1147 | //国内好价:qpp内打开 1148 | ".wrapper", 1149 | ".foot-banner", 1150 | ], 1151 | }, 1152 | ]; 1153 | 1154 | /** 1155 | * 主体部分 1156 | */ 1157 | for (let website of websites) { 1158 | if (location.href.indexOf(website.url) != -1) { 1159 | //隐藏/拦截骚扰元素 1160 | if (website.items) { 1161 | for (let item of website.items) { 1162 | addStyle(item + "{display: none !important}"); 1163 | } 1164 | } 1165 | //修复移动版页面不允许滑动 1166 | if (website.overflow) { 1167 | addStyle("body{overflow: auto !important}"); 1168 | } 1169 | //执行额外方案 1170 | if (website.fun) { 1171 | website.fun(); 1172 | } 1173 | } 1174 | } 1175 | 1176 | //默认监听 1177 | let LoginFlag = true; 1178 | //默认添加 1179 | let ClickFlag = true; 1180 | 1181 | /** 1182 | * 通过内容(xpath)获取节点 1183 | * 1184 | * @param {string} xpath 内容 1185 | * @param {Node} parent 父元素 1186 | * @return {Node} 元素 1187 | */ 1188 | function getXpath(xpath, parent) { 1189 | let xpathResult = document.evaluate(xpath, parent || document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); 1190 | return xpathResult.singleNodeValue; 1191 | } 1192 | 1193 | /** 1194 | * 向head标签内添加样式 1195 | * 1196 | * @param {string} text CSS样式 1197 | */ 1198 | function addStyle(text) { 1199 | let css = document.createElement("style"); 1200 | css.innerText += text; 1201 | document.head.append(css); 1202 | } 1203 | })(); 1204 | -------------------------------------------------------------------------------- /AutoDarkMode.md: -------------------------------------------------------------------------------- 1 | # AutoDarkMode UserScript 2 | 3 | [![GitHub license](https://img.shields.io/github/license/airbashX/UserScript.svg?style=flat-square&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 4 | [![GitHub Star](https://img.shields.io/github/stars/airbashX/UserScript.svg?style=flat-square&label=Star&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 5 | [![GitHub Fork](https://img.shields.io/github/forks/airbashX/UserScript.svg?style=flat-square&label=Fork&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 6 | 7 | ## 相关功能 8 | 9 | - 在支持多主题模式的网站中,系统会根据用户设定的时间自动切换到相应的主题模式 10 | 11 | ## 相关脚本 12 | 13 | | 名称 | 功能 | 14 | | :-------------------------------------------------------------- | :--------------------------------------------------------------------- | 15 | | **[自动展开](https://greasyfork.org/zh-CN/scripts/438656)** | 自动展开文章或新闻等`隐藏`、`折叠`部分 | 16 | | **[骚扰拦截](https://greasyfork.org/zh-CN/scripts/440871)** | 自动拦截`下载弹窗`、`悬浮按钮`、`登录弹窗`等影响用户体验的骚扰元素 | 17 | | **[链接管理](https://greasyfork.org/zh-CN/scripts/443670)** | 取消点击链接后跳转到安全页面 | 18 | | **[移除复制后缀](https://greasyfork.org/zh-CN/scripts/472307)** | 移除复制后附带的`后缀`、`网站声明` | 19 | | **[自动切换主题](https://greasyfork.org/zh-CN/scripts/532308)** | 在用户设定的时间点,自动切换网站的`主题模式`,如`白天模式`与`黑夜模式` | 20 | 21 | ## 适配网站 22 | 23 | | 网站名 | PC | Phone | 注释 | 24 | | --------- | --- | ----- | ------------------------------------------------------------------------ | 25 | | BiliBili | ✔ | | | 26 | | ChatGPT | ✔ | | | 27 | | GitHub | ✔ | | 需要一些操作才能使功能生效,具体查看 [GitHub 切换说明](#github-切换说明) | 28 | | Pixiv | ✔ | | | 29 | | Wikipedia | ✔ | | | 30 | | 风车动漫 | ✔ | | | 31 | 32 | 持续支持中... 33 | 34 | ## 注释 35 | 36 | ### GitHub 切换说明 37 | 38 | - 由于 GitHub 的主题切换功能隐藏得极为隐蔽,无法使用正常手段切换。唯一的方式需依赖还在测试阶段的 `Command Palette` 功能使用命令进行切换 39 | 40 | - 开启方式:`My Profile` -> `Feature preview` 中,将 `Command Palette` 设置为 `Enable` 41 | -------------------------------------------------------------------------------- /AutoDarkMode.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 自动主题切换 3 | // @namespace airbash/Rocy-June/AutoDarkMode 4 | // @homepage https://github.com/AirBashX/UserScript 5 | // @version 25.06.24.01 6 | // @description 根据用户设定时间段, 自动切换已适配网站的黑白主题 7 | // @author airbash / Rocy-June 8 | // @match *://*/* 9 | // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAolBMVEVHcExYYm2zfUHYhC34jx74kRv4jx1naGllZWVlZWX3khxmZmb3kB73jx/4kB33kBxmZmZmZmZhYWFoaGj3kB5iY2RnZ2f5jBtqampubm5paWn3kh33kB73kB5aWlr3kR5mZmb6mhz2iSBkZGT3kR33kR1lZmY7Ozt3d3dISEj9uRG0fkGqeUX3kB5mZmZkZWb/lhRpaWn3kR9jY2NxcXGzfUGVB4hkAAAALXRSTlMA9+kD3YkOfEWWIYvnWLN47W03XvW04S8ZCs6fRMcnCFEY/r/PaqhTxWFHqnwtZ5kAAAACpUlEQVRYw9WX65qaMBCGbQFBRUARXEHF8x7aDMuh939rTRCimAHiw/Zpm18aM+/OTubwZTD419fU+uhlH5nE7AUYmqmq9AKo5G8DzJ4AFsSnAC+Pp+3T+Rn7mTOSSo4xvr/1AGQAFjGH2L7hAPiKjD0he2RfB7rmtYC4k4v3wwq1msvMfoq7D6DfWc+OdCP+9uszTcnCOpdORyFu7zrM3uPfV3qxQQHfP0mxTDtiP+xRe2VSnPZX1cZrAPAAIERds6OaKtrPj0lx2uDhiAEBEGIXf028/DwpDCbVxihJYhRANOxW3PJwwO3hth4AB4zgXo8m1Q3qeTOApFhij1gE8uoG5hm0AMhhiRGYA9vyQgKI2wDkNMAJVQRmAK0ekHSKFSFkZQ4qfidARQAeZGUId9AFIGQtdhGHJ+FFAhCKmcirYOV0A5A+7/IsNEDCA7JEOsGsnpXtAOEeaC3uHquoDVDU1JitIU+DHUdJAGhBRNaCLfWjBGSGWEetgHGtwCeQvD7pgWJv2LLGpVleAvRMOgb1TOa3IAUQUnHH58lc6l94nEvKFrJj+dnPugFiQa/82ClrYRR3pzLS1i68I88lamGJ9QPekoNOgCXa0yDwqWp0AtZYTwtuU8XrAIToxHYhPt66SxsAVwZFI6nmgtEGSNcNooHm8BsP6W2yCYBpk+qgqZC/V1/esyYPps26hfYi54WLHR8FXOd7g8AaUD3yduvTF8gEQMiEEe0kWoNCdCC5k2iGBzGNRQlIaf5cw7dvGvK0JuMs1++bvR7EhUYiZLHReP7aaSNBvxcpTIkoW2Om/9TO6/G9LrGZD7ganNQATUuxkZZQXcVOShDbi81QXj5jgmL/hIAPD2G/N9MiNf/3N9MXPLr6xSA6pad+b+elvfzDr/Pf2oPrAJ6zWhcAAAAASUVORK5CYII= 10 | // @run-at document-body 11 | // @grant GM_registerMenuCommand 12 | // @grant GM_unregisterMenuCommand 13 | // @grant GM_setValue 14 | // @grant GM_getValue 15 | // @license GPL-3.0 16 | // ==/UserScript== 17 | 18 | (function () { 19 | "use strict"; 20 | 21 | // 调试模式开关 22 | const DEBUG = false; 23 | // 调试模式: 是否在报错时中断脚本运行 24 | const DEBUG_INTERRUPT_ON_ERROR = false; 25 | // 调试模式: 是否强制切换主题 26 | let DEBUG_FORCE_TOGGLE = false; 27 | 28 | // 日志函数 29 | const log = console.log.bind(console, "[AutoDarkMode Script]"); 30 | const warn = console.warn.bind(console, "[AutoDarkMode Script]"); 31 | const error = console.error.bind(console, "[AutoDarkMode Script]"); 32 | const debug = (() => 33 | DEBUG 34 | ? console.error.bind(console, "[AutoDarkMode Script] [Debug Mode]") 35 | : () => {})(); 36 | 37 | debug("Debug mode is on"); 38 | 39 | // 失败检测计数器 40 | let fail_count = 0; 41 | // 失败检查时间间隔, 单位: 毫秒 42 | let fail_check_time = 10000; 43 | 44 | const sim_events = { 45 | pointer_down: () => 46 | new PointerEvent("pointerdown", { 47 | bubbles: true, 48 | cancelable: true, 49 | pointerType: "mouse", 50 | }), 51 | mouse_over: () => 52 | new MouseEvent("mouseover", { 53 | bubbles: true, 54 | cancelable: true, 55 | relatedTarget: null, 56 | }), 57 | mouse_leave: () => 58 | new MouseEvent("mouseleave", { 59 | bubbles: true, 60 | cancelable: true, 61 | relatedTarget: null, 62 | }), 63 | mouse_enter: () => 64 | new MouseEvent("mouseenter", { 65 | bubbles: true, 66 | cancelable: true, 67 | relatedTarget: null, 68 | }), 69 | key: (is_down, key, modifiers = {}) => { 70 | const key_codes = { 71 | control: "ControlLeft", 72 | alt: "AltLeft", 73 | shift: "ShiftLeft", 74 | meta: "MetaLeft", 75 | enter: "Enter", 76 | }; 77 | 78 | const key_code = 79 | key_codes[key.toLowerCase()] || `Key${key.toUpperCase()}`; 80 | 81 | const { 82 | ctrl = false, 83 | meta = false, 84 | shift = false, 85 | alt = false, 86 | bubbles = true, 87 | cancelable = true, 88 | } = modifiers; 89 | 90 | return new KeyboardEvent(is_down ? "keydown" : "keyup", { 91 | key: key.toUpperCase(), 92 | code: key_code, 93 | ctrlKey: ctrl, 94 | metaKey: meta, 95 | shiftKey: shift, 96 | altKey: alt, 97 | bubbles, 98 | cancelable, 99 | }); 100 | }, 101 | }; 102 | 103 | log("脚本开始运行"); 104 | 105 | // 设置对象 106 | const settings = { 107 | // 默认明亮主题起始时间 108 | light_time: "08:00", 109 | // 默认黑夜主题起始时间 110 | dark_time: "18:00", 111 | // 油猴菜单: 明亮主题设置菜单ID 112 | light_menu_id: null, 113 | // 油猴菜单: 黑夜主题设置菜单ID 114 | dark_menu_id: null, 115 | // 油猴菜单: Debug强制切换菜单ID 116 | debug_toggle_id: null, 117 | 118 | // 默认快速检查时间 (Debug 模式且开启报错中断时将延长) 119 | fast_check_default_time: DEBUG && DEBUG_INTERRUPT_ON_ERROR ? 3000 : 200, 120 | // 快速检查过后的常态检查时间 (Debug 模式且开启报错中断时将延长) 121 | after_check_default_time: DEBUG && DEBUG_INTERRUPT_ON_ERROR ? 3600000 : 10000, 122 | }; 123 | 124 | // 初始化设置 125 | initSettings(); 126 | 127 | // 所有适配的站点 128 | /* 129 | { 130 | "domain (站点域名匹配, 防止后续匹配项过多, 提高加载速度)": [{ 131 | url: 匹配站点正则, 132 | check: 检查当前主题函数(返回 "dark" 或 "light"), 133 | toggle: 切换主题函数(可选, 为 null 时 toLight 和 toDark 函数会被调用), 134 | toLight: 切换到明亮主题函数(可选, toggle 为 null 时必需设定), 135 | toDark: 切换到黑夜主题函数(可选, toggle 为 null 时必需设定), 136 | fastCheckTime: 未成功检查 / 切换主题前的检查主题间隔时间(可选, 为 null 时默认 1 秒), 137 | afterCheckTime: 无需切换或切换成功后, 再次检查主题间隔时间(可选, 为 null 时默认 10 秒), 138 | }] 139 | } 140 | 141 | tip: 142 | 如果新增站点有新的顶级域名, 143 | 记得同步增加到 sites 下方的 domain_suffixes 144 | */ 145 | const sites = { 146 | // Pixiv 147 | "pixiv.net": [ 148 | { 149 | url: /^https?:\/\/.*?pixiv\.net.*/, 150 | check: () => 151 | html().getAttribute("data-theme") === "dark" ? "dark" : "light", 152 | toLight: () => { 153 | $single(".gtm-darkmode-toggle-on-user-menu-to-light").click(); 154 | }, 155 | toDark: () => { 156 | $single(".gtm-darkmode-toggle-on-user-menu-to-dark").click(); 157 | }, 158 | }, 159 | ], 160 | // 风车动漫 161 | "fengchedmp.com": [ 162 | { 163 | url: /^https?:\/\/.*?fengchedmp\.com.*/, 164 | check: () => 165 | $single("#cssFile").getAttribute("href").includes("black") 166 | ? "dark" 167 | : "light", 168 | toLight: () => { 169 | $single("i.icon-rijian").click(); 170 | }, 171 | toDark: () => { 172 | $single("i.icon-yejian").click(); 173 | }, 174 | }, 175 | ], 176 | // Wikipedia 177 | "wikipedia.org": [ 178 | { 179 | url: /^https?:\/\/.*?wikipedia\.org.*/, 180 | check: () => 181 | html().classList.contains("skin-theme-clientpref-night") 182 | ? "dark" 183 | : "light", 184 | toLight: () => { 185 | $single("#skin-client-pref-skin-theme-value-day").click(); 186 | }, 187 | toDark: () => { 188 | $single("#skin-client-pref-skin-theme-value-night").click(); 189 | }, 190 | }, 191 | ], 192 | // ChatGPT 193 | "chatgpt.com": [ 194 | { 195 | url: /^https?:\/\/.*?chatgpt\.com.*/, 196 | check: () => (html().classList.contains("dark") ? "dark" : "light"), 197 | toLight: async () => { 198 | $single( 199 | "#conversation-header-actions button[data-testid=profile-button]" 200 | ).dispatchEvent(sim_events.pointer_down()); 201 | ( 202 | await $singleAsync("div[data-radix-popper-content-wrapper]") 203 | ).style.opacity = 0; 204 | 205 | $single("div[data-testid=settings-menu-item]").click(); 206 | ( 207 | await $singleAsync("div[data-testid=modal-settings]") 208 | ).style.opacity = 0; 209 | 210 | $single( 211 | "div.flex.items-center.justify-between button[role=combobox]" 212 | ).dispatchEvent(sim_events.pointer_down()); 213 | ( 214 | await $singleAsync("div[data-radix-popper-content-wrapper]") 215 | ).style.opacity = 0; 216 | 217 | $single( 218 | "div[data-radix-select-viewport] div[role=option]:nth-child(3)" 219 | ).click(); 220 | $single("button[data-testid=close-button]").click(); 221 | }, 222 | toDark: async () => { 223 | $single( 224 | "#conversation-header-actions button[data-testid=profile-button]" 225 | ).dispatchEvent(sim_events.pointer_down()); 226 | ( 227 | await $singleAsync("div[data-radix-popper-content-wrapper]") 228 | ).style.opacity = 0; 229 | 230 | $single("div[data-testid=settings-menu-item]").click(); 231 | ( 232 | await $singleAsync("div[data-testid=modal-settings]") 233 | ).style.opacity = 0; 234 | 235 | $single( 236 | "div.flex.items-center.justify-between button[role=combobox]" 237 | ).dispatchEvent(sim_events.pointer_down()); 238 | ( 239 | await $singleAsync("div[data-radix-popper-content-wrapper]") 240 | ).style.opacity = 0; 241 | 242 | $single( 243 | "div[data-radix-select-viewport] div[role=option]:nth-child(2)" 244 | ).click(); 245 | $single("button[data-testid=close-button]").click(); 246 | }, 247 | load: () => { 248 | document.addEventListener("visibilitychange", function () { 249 | if (document.visibilityState === "visible") { 250 | let modal_settings = $single("div[data-testid=modal-settings]"); 251 | if (!modal_settings) { 252 | return; 253 | } 254 | 255 | $single("button[data-testid=close-button]").click(); 256 | } 257 | }); 258 | } 259 | }, 260 | ], 261 | // GitHub 262 | "github.com": [ 263 | { 264 | url: /^https?:\/\/.*?github\.com.*/, 265 | check: () => 266 | html().getAttribute("data-color-mode") === "dark" ? "dark" : "light", 267 | toLight: async () => { 268 | document.body.dispatchEvent( 269 | sim_events.key(true, "k", { ctrl: true, shift: true }) 270 | ); 271 | const command_container = $single("#command-palette-pjax-container"); 272 | command_container.style.opacity = 0; 273 | 274 | const command_palette = $single( 275 | "input[aria-controls=command-palette-page-stack]" 276 | ); 277 | command_palette.value = ">switch theme"; 278 | 279 | ( 280 | await $singleAsync("div[role=listbox]>command-palette-item>span") 281 | ).click(); 282 | 283 | let flag = await waitForAsync(() => { 284 | return $single("svg[aria-label=Loading]").parentNode.hasAttribute( 285 | "hidden" 286 | ); 287 | }); 288 | if (!flag) { 289 | throw new Error("Waiting for load ready failed"); 290 | } 291 | 292 | command_palette.value = "default light"; 293 | 294 | ( 295 | await $selectSingleAsync( 296 | "div[role=listbox]>command-palette-item>span", 297 | (e) => { 298 | return e.innerText.toLowerCase().includes("default light"); 299 | } 300 | ) 301 | ).click(); 302 | command_container.style.opacity = 1; 303 | }, 304 | toDark: async () => { 305 | document.body.dispatchEvent( 306 | sim_events.key(true, "k", { ctrl: true, shift: true }) 307 | ); 308 | const command_container = $single("#command-palette-pjax-container"); 309 | command_container.style.opacity = 0; 310 | 311 | const command_palette = $single( 312 | "input[aria-controls=command-palette-page-stack]" 313 | ); 314 | command_palette.value = ">switch theme"; 315 | 316 | ( 317 | await $singleAsync("div[role=listbox]>command-palette-item>span") 318 | ).click(); 319 | 320 | let flag = await waitForAsync(() => { 321 | return $single("svg[aria-label=Loading]").parentNode.hasAttribute( 322 | "hidden" 323 | ); 324 | }); 325 | if (!flag) { 326 | throw new Error("Waiting for load ready failed"); 327 | } 328 | 329 | command_palette.value = "default dark"; 330 | 331 | ( 332 | await $selectSingleAsync( 333 | "div[role=listbox]>command-palette-item>span", 334 | (e) => { 335 | return e.innerText.toLowerCase().includes("default dark"); 336 | } 337 | ) 338 | ).click(); 339 | command_container.style.opacity = 1; 340 | }, 341 | }, 342 | ], 343 | // Bilibili 344 | "bilibili.com": [ 345 | { 346 | url: /^https?:\/\/.*?bilibili\.com.*/, 347 | check: () => 348 | html().classList.contains("night-mode") ? "dark" : "light", 349 | toLight: async () => { 350 | let flag = await waitForTimerAsync(() => $single("li.v-popover-wrap.header-avatar-wrap") != null, 200, 10000); 351 | if (!flag) { 352 | throw new Error("Waiting for links-item created failed"); 353 | } 354 | 355 | let avatar = $single("li.v-popover-wrap.header-avatar-wrap") 356 | avatar.dispatchEvent(sim_events.mouse_enter()); 357 | await nextFrame(); 358 | avatar.dispatchEvent(sim_events.mouse_leave()); 359 | 360 | flag = await waitForTimerAsync(() => $all(".links-item").length > 0, 200, 10000); 361 | if (!flag) { 362 | throw new Error("Waiting for links-item created failed"); 363 | } 364 | 365 | let links_item = $all(".links-item"); 366 | let single_link_item = $single(links_item[links_item.length - 1], ".single-link-item") 367 | single_link_item.dispatchEvent(sim_events.mouse_enter()); 368 | 369 | flag = await waitForAsync(() => single_link_item.nextElementSibling?.classList.contains("v-popover")); 370 | if (!flag) { 371 | throw new Error("Waiting for popover created failed"); 372 | } 373 | 374 | let popover = single_link_item.nextElementSibling; 375 | let options = $all(popover, ".single-link-item.sub-link-item") 376 | options[1].click(); 377 | }, 378 | toDark: async () => { 379 | let avatar = $single("li.v-popover-wrap.header-avatar-wrap") 380 | avatar.dispatchEvent(sim_events.mouse_enter()); 381 | await nextFrame(); 382 | avatar.dispatchEvent(sim_events.mouse_leave()); 383 | 384 | let flag = await waitForTimerAsync(() => $all(".links-item").length > 0, 200, 10000); 385 | if (!flag) { 386 | throw new Error("Waiting for links-item created failed"); 387 | } 388 | 389 | let links_item = $all(".links-item"); 390 | let single_link_item = $single(links_item[links_item.length - 1], ".single-link-item") 391 | single_link_item.dispatchEvent(sim_events.mouse_enter()); 392 | 393 | flag = await waitForAsync(() => single_link_item.nextElementSibling?.classList.contains("v-popover")); 394 | if (!flag) { 395 | throw new Error("Waiting for popover created failed"); 396 | } 397 | 398 | let popover = single_link_item.nextElementSibling; 399 | let options = $all(popover, ".single-link-item.sub-link-item") 400 | options[0].click(); 401 | }, 402 | load: () => { 403 | document.addEventListener("visibilitychange", async function () { 404 | if (document.visibilityState === "visible") { 405 | await nextTick(); 406 | $single("li.v-popover-wrap.header-avatar-wrap>.v-popover").dispatchEvent( 407 | sim_events.mouse_leave() 408 | ); 409 | } 410 | }); 411 | } 412 | }, 413 | ], 414 | }; 415 | 416 | const domain_suffixes = [ 417 | ".com.cn", 418 | ".com", 419 | ".org", 420 | ".net", 421 | ".edu", 422 | ".gov", 423 | ".cn", 424 | ]; 425 | 426 | // 匹配到的域名设置 427 | const no_www_domain = getRootDomain(location.hostname); 428 | 429 | const domain_setting = sites[no_www_domain]; 430 | if (!domain_setting) { 431 | log(`未找到适配的站点: ${no_www_domain}`); 432 | return; 433 | } 434 | 435 | // 匹配到的网站设置 436 | const site_setting = domain_setting.find((s) => s.url.test(location.href)); 437 | if (!site_setting) { 438 | log(`未找到当前页面的适配操作`); 439 | return; 440 | } 441 | 442 | // 加载完成后开始检查主题 443 | addEventListener("load", async () => { 444 | 445 | site_setting.load?.(); 446 | 447 | const timer = new Timer( 448 | intervalFunc, 449 | site_setting.afterCheckTime || settings.after_check_default_time 450 | ); 451 | 452 | await intervalFunc(); 453 | 454 | timer.start(); 455 | 456 | async function intervalFunc() { 457 | try { 458 | await checkAndChangeTheme(); 459 | 460 | fail_count = 0; 461 | timer.delay = site_setting.afterCheckTime || settings.after_check_default_time; 462 | 463 | log("检查/操作完成, 切换到慢速模式"); 464 | } catch (ex) { 465 | if (DEBUG) { 466 | if (DEBUG_INTERRUPT_ON_ERROR) { 467 | debug("检查/操作失败, 中断脚本运行", ex); 468 | return; 469 | } 470 | 471 | debug("检查/操作失败", ex); 472 | } 473 | 474 | fail_count++; 475 | if ( 476 | fail_count >= 477 | fail_check_time / 478 | (site_setting.fastCheckTime || settings.fast_check_default_time) 479 | ) { 480 | timer.delay = 481 | site_setting.afterCheckTime || settings.after_check_default_time; 482 | error("失败超出时长限制, 切换到慢速模式"); 483 | return; 484 | } 485 | 486 | timer.delay = 487 | site_setting.fastCheckTime || settings.fast_check_default_time; 488 | error("检查/操作失败, 切换到高速模式", ex); 489 | } 490 | } 491 | }); 492 | 493 | // 查找元素, 用法类似于 jQuery 494 | function $single(arg1, arg2) { 495 | if (arguments.length == 2) { 496 | return $single2(arg1, arg2); 497 | } 498 | return $single1(arg1); 499 | } 500 | function $single1(selector) { 501 | return document.querySelector(selector); 502 | } 503 | function $single2(dom, selector) { 504 | return dom.querySelector(selector); 505 | } 506 | 507 | /* 508 | 类似 jQuery 的元素查找函数 509 | 510 | 适用于连续操作中可能影响用户操作体验的场景, 该方式会尽可能在渲染的同一帧内找到该 DOM 元素, 511 | 以缩短元素变更对用户交互的干扰时间 (如弹窗在显示帧立即点击关闭按钮) 512 | 513 | 与 singleTimerAsync 不同的是, 本函数每一帧都会进行查询, 因此可能对性能造成一定影响 514 | 如果操作不会显著影响用户体验, 则推荐使用 singleTimerAsync 515 | */ 516 | async function $singleAsync(selector, timeout = 1000) { 517 | const start = Date.now(); 518 | while (Date.now() - start < timeout) { 519 | const ele = $single(selector); 520 | if (ele) { 521 | return ele; 522 | } 523 | 524 | await nextFrame(); 525 | } 526 | 527 | throw new Error("Timeout"); 528 | } 529 | 530 | /* 531 | 类似 jQuery 的元素查找函数 532 | 533 | 适用于不会改变页面结构、或不影响用户操作体验的场景 534 | 使用自定义 Timer 以固定间隔查询元素, 性能开销较小, 但查找速度相对较慢 535 | 536 | 与 singleAsync 不同的是, 该函数通过节流方式降低性能消耗, 537 | 更适合异步检查某些静态区域元素是否已加载完成等情况 538 | */ 539 | function $singleTimerAsync(selector, interval = 100, timeout = 1000) { 540 | return promise(async (resolve, reject) => { 541 | const start = Date.now(); 542 | const timer = new Timer(() => { 543 | const ele = $single(selector); 544 | if (ele) { 545 | resolve(ele); 546 | timer.stop(); 547 | return; 548 | } 549 | if (Date.now() - start >= timeout) { 550 | reject(new Error("Timeout")); 551 | timer.stop(); 552 | return; 553 | } 554 | }, interval); 555 | timer.start(true); 556 | }); 557 | } 558 | 559 | // 用于查找无法单纯使用 CSS 选择器的复杂元素 560 | async function $selectSingleAsync(selector, filter, timeout = 1000) { 561 | const start = Date.now(); 562 | while (Date.now() - start < timeout) { 563 | const eles = $all(selector); 564 | if (eles.length) { 565 | let selected = Array.from(eles).filter(filter); 566 | if (selected.length) { 567 | return selected[0]; 568 | } 569 | } 570 | 571 | await nextFrame(); 572 | } 573 | 574 | throw new Error("Timeout"); 575 | } 576 | 577 | function $all(arg1, arg2) { 578 | if (arguments.length == 2) { 579 | return $all2(arg1, arg2); 580 | } 581 | return $all1(arg1); 582 | } 583 | function $all1(selector) { 584 | return document.querySelectorAll(selector); 585 | } 586 | function $all2(dom, selector) { 587 | return dom.querySelectorAll(selector); 588 | } 589 | 590 | function html() { 591 | return document.documentElement; 592 | } 593 | 594 | // 初始化设置 595 | function initSettings() { 596 | log("初始化设置"); 597 | 598 | settings.light_time = GM_getValue("light_time", settings.light_time); 599 | settings.dark_time = GM_getValue("dark_time", settings.dark_time); 600 | 601 | refreshMenuCommand(); 602 | } 603 | 604 | // 获取根域名 605 | function getRootDomain(domain) { 606 | for (const suffix of domain_suffixes) { 607 | if (!domain.endsWith(suffix)) { 608 | continue; 609 | } 610 | 611 | const index = domain.lastIndexOf(".", suffix.length); 612 | return domain.substring(index + 1); 613 | } 614 | } 615 | 616 | // 检查当前时间是否需要切换主题 617 | async function checkAndChangeTheme() { 618 | log("开始检查主题"); 619 | 620 | const light_minutes = timeToMinutes(settings.light_time); 621 | const dark_minutes = timeToMinutes(settings.dark_time); 622 | 623 | let now = nowMinutes(); 624 | 625 | const current_theme = site_setting.check(); 626 | log(`当前主题:${current_theme}`); 627 | 628 | if (DEBUG && DEBUG_FORCE_TOGGLE) { 629 | debug("强制切换主题"); 630 | if ( 631 | now >= light_minutes && 632 | now < dark_minutes && 633 | current_theme === "light" 634 | ) { 635 | now = dark_minutes; 636 | debug("将当前时间设置为黑夜时间"); 637 | } else if ( 638 | (now >= dark_minutes || now < light_minutes) && 639 | current_theme === "dark" 640 | ) { 641 | now = light_minutes; 642 | debug("将当前时间设置为明亮时间"); 643 | } 644 | } 645 | 646 | if (now >= light_minutes && now < dark_minutes) { 647 | if (current_theme === "light") { 648 | log("当前时间为明亮主题时间, 无需切换"); 649 | return; 650 | } 651 | if (site_setting.toggle) { 652 | log("切换到明亮主题 - toggle"); 653 | await site_setting.toggle(); 654 | log("切换完成"); 655 | return; 656 | } 657 | if (site_setting.toLight) { 658 | log("切换到明亮主题 - toLight"); 659 | await site_setting.toLight(); 660 | log("切换完成"); 661 | return; 662 | } 663 | 664 | error("切换到明亮主题 - 未指定切换函数"); 665 | } else { 666 | if (current_theme === "dark") { 667 | log("当前时间为黑夜主题时间, 无需切换"); 668 | return; 669 | } 670 | if (site_setting.toggle) { 671 | log("切换到黑夜主题 - toggle"); 672 | await site_setting.toggle(); 673 | log("切换完成"); 674 | return; 675 | } 676 | if (site_setting.toDark) { 677 | log("切换到黑夜主题 - toDark"); 678 | await site_setting.toDark(); 679 | log("切换完成"); 680 | return; 681 | } 682 | 683 | error("切换到黑夜主题 - 未指定切换函数"); 684 | } 685 | } 686 | 687 | // 刷新菜单 688 | function refreshMenuCommand() { 689 | log("刷新脚本菜单"); 690 | 691 | if (settings.light_menu_id) { 692 | GM_unregisterMenuCommand(settings.light_menu_id); 693 | } 694 | if (settings.dark_menu_id) { 695 | GM_unregisterMenuCommand(settings.dark_menu_id); 696 | } 697 | if (settings.debug_toggle_id) { 698 | GM_unregisterMenuCommand(settings.debug_toggle_id); 699 | } 700 | 701 | settings.light_menu_id = GM_registerMenuCommand( 702 | `设置明亮时间 (${settings.light_time})`, 703 | () => setTimePrompt("light_time", "明亮时间") 704 | ); 705 | settings.dark_menu_id = GM_registerMenuCommand( 706 | `设置黑夜时间 (${settings.dark_time})`, 707 | () => setTimePrompt("dark_time", "黑夜时间") 708 | ); 709 | if (DEBUG) { 710 | settings.debug_toggle_id = GM_registerMenuCommand( 711 | `调试模式: 强制切换主题`, 712 | async () => { 713 | DEBUG_FORCE_TOGGLE = true; 714 | try { 715 | await checkAndChangeTheme(); 716 | } 717 | finally { 718 | DEBUG_FORCE_TOGGLE = false; 719 | } 720 | } 721 | ); 722 | } 723 | } 724 | 725 | // 设置时间提示框 726 | function setTimePrompt(key, label) { 727 | log(`设置${label}提示框`); 728 | 729 | const old_val = GM_getValue(key, settings[key]); 730 | 731 | log(`旧${label}:${old_val}`); 732 | 733 | const new_val = prompt(`设置${label}(格式 HH:mm):`, old_val); 734 | log(`用户输入: ${new_val}`); 735 | if (!new_val) { 736 | return; 737 | } 738 | if ( 739 | !new_val || 740 | !/^([0-1][0-9]|2[0-3])[::]([0-5][0-9])$/.test(new_val) 741 | ) { 742 | alert('格式不正确, 时间格式为 "08:00"'); 743 | return; 744 | } 745 | const standard_new_val = new_val.replace(":", ":"); 746 | 747 | log(`新${label}:${standard_new_val}`); 748 | 749 | const tmp = standard_new_val; 750 | settings[key] = standard_new_val; 751 | if ( 752 | timeToMinutes(settings.light_time) > timeToMinutes(settings.dark_time) 753 | ) { 754 | log("黑夜时间不能早于明亮时间"); 755 | 756 | settings[key] = tmp; 757 | alert("黑夜时间不能早于明亮时间"); 758 | return; 759 | } 760 | 761 | GM_setValue(key, standard_new_val); 762 | 763 | log(`${label} 已设置为:${standard_new_val}`); 764 | 765 | alert(`${label} 已设置为:${standard_new_val}`); 766 | 767 | refreshMenuCommand(); 768 | } 769 | 770 | // 将时间字符串转为分钟 771 | function timeToMinutes(time) { 772 | const [hour, minute] = time.split(":").map(Number); 773 | return hour * 60 + minute; 774 | } 775 | 776 | // 获取当前时间的分钟数 777 | function nowMinutes() { 778 | const now = new Date(); 779 | return now.getHours() * 60 + now.getMinutes(); 780 | } 781 | 782 | // 将函数加入下一轮事件循环 783 | function nextTick(func) { 784 | return Promise.resolve().then(() => { 785 | func(); 786 | }); 787 | } 788 | 789 | // 等待下一帧 790 | function nextFrame(func) { 791 | return new Promise((resolve) => { 792 | requestAnimationFrame((timestamp) => { 793 | func?.(timestamp); 794 | resolve(timestamp); 795 | }); 796 | }); 797 | } 798 | 799 | // 异步函数返回 Promise 800 | function promise(func) { 801 | return new Promise((resolve, reject) => { 802 | try { 803 | func(resolve, reject); 804 | } catch (ex) { 805 | reject(ex); 806 | } 807 | }); 808 | } 809 | 810 | // 等待指定时间 811 | function waitTimeAsync(time) { 812 | return new Promise((resolve) => { 813 | setTimeout(() => { 814 | resolve(); 815 | }, time); 816 | }); 817 | } 818 | 819 | /* 820 | 等待某个元素达到某个状态 821 | 822 | 适用于连续操作中可能影响用户操作体验的场景, 该方式会在渲染的每一帧内检测该 DOM 元素的状态, 823 | 以缩短元素变更对用户交互的干扰时间 (如弹窗在显示帧立即点击关闭按钮) 824 | 825 | 与 waitForTimerAsync 不同的是, 本函数每一帧都会进行查询, 因此可能对性能造成一定影响 826 | 如果操作不会显著影响用户体验, 则推荐使用 waitForTimerAsync 827 | */ 828 | async function waitForAsync(detector, timeout = 1000) { 829 | if (!detector) throw new Error("detector can not be null."); 830 | 831 | const start = Date.now(); 832 | while (Date.now() - start < timeout) { 833 | if (detector()) { 834 | return true; 835 | } 836 | 837 | await nextFrame(); 838 | } 839 | 840 | return false; 841 | } 842 | 843 | /* 等待某个元素达到某个状态 844 | 845 | 适用于不会改变页面结构、或不影响用户操作体验的场景 846 | 使用自定义 Timer 以固定间隔查询元素, 性能开销较小, 但查找速度相对较慢 847 | 848 | 与 waitForAsync 不同的是, 该函数通过节流方式降低性能消耗, 849 | 更适合异步检查某些静态区域元素是否已加载完成等情况 850 | */ 851 | function waitForTimerAsync(detector, interval = 100, timeout = 1000) { 852 | if (!detector) throw new Error("detector can not be null."); 853 | 854 | return promise(async (resolve, reject) => { 855 | const start = Date.now(); 856 | const timer = new Timer(() => { 857 | if (detector()) { 858 | resolve(true); 859 | timer.stop(); 860 | return; 861 | } 862 | if (Date.now() - start >= timeout) { 863 | reject(new Error("Timeout")); 864 | timer.stop(); 865 | return; 866 | } 867 | }, interval); 868 | timer.start(true); 869 | }); 870 | } 871 | 872 | // 自建定时器 873 | class Timer { 874 | #timer = null; 875 | #func = null; 876 | delay = 0; 877 | 878 | constructor(func, delay) { 879 | this.#func = func; 880 | this.delay = delay; 881 | } 882 | 883 | start(immediate = false) { 884 | this.stop(); 885 | 886 | let start_new = async () => { 887 | if (immediate) { 888 | await this.#func(); 889 | } 890 | 891 | this.#timer = setTimeout(async () => { 892 | await this.#func(); 893 | this.start(); 894 | }, this.delay); 895 | }; 896 | start_new(); 897 | } 898 | 899 | stop() { 900 | clearTimeout(this.#timer); 901 | } 902 | } 903 | })(); 904 | -------------------------------------------------------------------------------- /AutoUnfold.md: -------------------------------------------------------------------------------- 1 | # AutoUnfold UserScript 2 | 3 | [![GitHub license](https://img.shields.io/github/license/airbashX/UserScript.svg?style=flat-square&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 4 | [![GitHub Star](https://img.shields.io/github/stars/airbashX/UserScript.svg?style=flat-square&label=Star&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 5 | [![GitHub Fork](https://img.shields.io/github/forks/airbashX/UserScript.svg?style=flat-square&label=Fork&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 6 | [![jsDelivr](https://data.jsdelivr.com/v1/package/gh/airbashX/UserScript/badge)](https://www.jsdelivr.com/package/gh/airbashX/UserScript) 7 | [![GreasyFork](https://img.shields.io/static/v1?label=%20&message=GreasyFork&style=flat-square&labelColor=7B0000&color=960000&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII=)](https://greasyfork.org/zh-CN/users/698573-厌学的骚年) 8 | 9 | ## 相关功能 10 | 11 | 自动展开隐藏的内容(拦截悬浮弹窗需要安装我的另一个脚本[骚扰拦截](https://greasyfork.org/zh-CN/scripts/440871)) 12 | 13 | ## 注意事项 14 | 15 | 本脚本在`1.3`版本之后将`骚扰拦截`+`悬浮图标`+`app弹窗`+`百度搜索小程序`+`登录提示`功能单独做成了[骚扰拦截](https://greasyfork.org/zh-CN/scripts/440871)脚本,以方便用户自行选择,有需求的同学可以去[骚扰拦截](https://greasyfork.org/zh-CN/scripts/440871)页面安装; 16 | 17 | 友情提示:两个脚本搭配使用效果更佳奥! 18 | 19 | 代码中尽量不使用正则表达式,以获得最佳体验 20 | 21 | > 知乎官网默认不支持未登录查看内容了,暂无解决方案,需要登录后才能展开 22 | 23 | ## 相关脚本 24 | 25 | | 名称 | 功能 | 26 | | :-------------------------------------------------------------- | :--------------------------------------------------------------------- | 27 | | **[自动展开](https://greasyfork.org/zh-CN/scripts/438656)** | 自动展开文章或新闻等`隐藏`、`折叠`部分 | 28 | | **[骚扰拦截](https://greasyfork.org/zh-CN/scripts/440871)** | 自动拦截`下载弹窗`、`悬浮按钮`、`登录弹窗`等影响用户体验的骚扰元素 | 29 | | **[链接管理](https://greasyfork.org/zh-CN/scripts/443670)** | 取消点击链接后跳转到安全页面 | 30 | | **[移除复制后缀](https://greasyfork.org/zh-CN/scripts/472307)** | 移除复制后附带的`后缀`、`网站声明` | 31 | | **[自动切换主题](https://greasyfork.org/zh-CN/scripts/532308)** | 在用户设定的时间点,自动切换网站的`主题模式`,如`白天模式`与`黑夜模式` | 32 | 33 | ## 适配网站 34 | 35 | | 网站名 | PC | Phone | 其他功能 | 36 | | ---------------- | --- | ----- | ---------- | 37 | | CSDN | ✔ | ✔ | 免关注查看 | 38 | | CSDN 问答 | ✔ | ✔ | | 39 | | 编程之家 | ✔ | ✔ | 免验证查看 | 40 | | 简书 | ✔ | ✔ | | 41 | | 知乎 | ✔ | ✔ | 仅限登陆后 | 42 | | 百家号 | ✔ | ✔ | | 43 | | 百家资讯 | ✔ | ✔ | | 44 | | 百家百科 | ✔ | ✔ | | 45 | | 百度经验 | ✔ | ✔ | | 46 | | 百度知道 | ✔ | ✔ | | 47 | | 百度贴吧 | ✔ | ✔ | | 48 | | 百度文库 | | ✔ | | 49 | | 百度题库 | | ✔ | | 50 | | 百度新闻 | ✔ | ✔ | | 51 | | 新浪新闻 | ✔ | ✔ | | 52 | | 腾讯新闻 | ✔ | ✔ | | 53 | | 搜狐新闻 | ✔ | ✔ | | 54 | | 网易新闻 | ✔ | ✔ | | 55 | | 凤凰新闻 | ✔ | ✔ | | 56 | | 澎湃新闻 | ✔ | ✔ | | 57 | | 新京报 | ✔ | ✔ | | 58 | | 环球网 | ✔ | ✔ | | 59 | | 央广网 | ✔ | ✔ | | 60 | | 人民日报 | ✔ | ✔ | | 61 | | 人民网 | ✔ | ✔ | | 62 | | 中华网 | ✔ | ✔ | | 63 | | 今日头条 | ✔ | ✔ | | 64 | | 东方资讯 | ✔ | ✔ | | 65 | | 36 氪 | ✔ | ✔ | | 66 | | 果壳 | ✔ | ✔ | | 67 | | 虎扑 | ✔ | ✔ | | 68 | | 虎嗅 | ✔ | ✔ | | 69 | | 头条 | ✔ | ✔ | | 70 | | 丁香园 | ✔ | ✔ | | 71 | | 健康界 | ✔ | ✔ | | 72 | | 有来医生 | ✔ | ✔ | | 73 | | 哔哩哔哩 | ✔ | ✔ | | 74 | | B 站文章 | ✔ | ✔ | | 75 | | B 站笔记 | ✔ | ✔ | | 76 | | 微博文章 | ✔ | | 免关注查看 | 77 | | 豆瓣 | ✔ | ✔ | | 78 | | 豆瓣文章 | ✔ | ✔ | | 79 | | 开源中国 | ✔ | ✔ | | 80 | | 阿里云开发者社区 | ✔ | ✔ | 免关注查看 | 81 | | 腾讯云开发者社区 | ✔ | ✔ | 免关注查看 | 82 | | 华为云开发者社区 | ✔ | ✔ | 免关注查看 | 83 | | 360 图书馆 | ✔ | ✔ | | 84 | | 太平洋电脑网 | ✔ | ✔ | | 85 | | 中关村在线 | ✔ | ✔ | | 86 | | 汽车之家 | ✔ | ✔ | | 87 | | 游侠网 | ✔ | ✔ | | 88 | | 游民星空 | ✔ | ✔ | | 89 | | 网易大神 | ✔ | ✔ | | 90 | | 360 文档 | ✔ | ✔ | | 91 | | 天眼查 | ✔ | ✔ | | 92 | | 天涯社区 | ✔ | ✔ | | 93 | | 新浪财经 | ✔ | ✔ | | 94 | | 东方财富网 | ✔ | ✔ | | 95 | | 喜马拉雅 | ✔ | ✔ | | 96 | | 古诗文网 | ✔ | | | 97 | | it1352 | ✔ | ✔ | 免验证查看 | 98 | | 淘嘟嘟 | ✔ | ✔ | | 99 | | 代码随想录 | ✔ | ✔ | 免验证查看 | 100 | | 程序猿 DD | ✔ | ✔ | 免验证查看 | 101 | | 好网角收藏夹 | ✔ | ✔ | 免验证查看 | 102 | | 科中资源网 | ✔ | ✔ | | 103 | | tofacebook | ✔ | ✔ | | 104 | 105 | 持续支持中... 106 | -------------------------------------------------------------------------------- /AutoUnfold.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 自动展开 3 | // @version 1.3.81 4 | // @namespace https://github.com/AirBashX/AutoUnfold/ 5 | // @homepageURL https://github.com/AirBashX/UserScript 6 | // @author airbash 7 | // @description 自动展开文档 隐藏部分;长期维护、PC+手机全平台支持;全平台支持:CSDN、编程之家、简书、知乎、百家号、百度资讯、百度百科、百度经验、百度知道、百度贴吧、百度新闻、新浪新闻、腾讯新闻、搜狐新闻、网易新闻、凤凰新闻、澎湃新闻、新京报、央广网、环球网、人民日报、人民网、中华网、今日头条、东方资讯、丁香园、有来医生、健康界、36氪、果壳、虎扑、虎嗅、头条、B站专栏、B站笔记、微博文章、豆瓣文章、豆瓣小组、开源中国、阿里云开发者社区、腾讯云开发者社区、华为云开发者社区、360图书馆、太平洋电脑网、中关村在线、汽车之家、游侠网、游民星空、网易大神、360问答、天眼查、天涯社区、新浪财经、东方财富网、喜马拉雅、it1352、代码随想录、古诗文网 8 | // @match *://*.blog.csdn.net/* 9 | // @match *://blog.csdn.net/* 10 | // @match *://ask.csdn.net/questions/* 11 | // @match *://download.csdn.net/download/* 12 | // @match *://wenku.csdn.net/answer/* 13 | // @match *://*.jb51.cc/* 14 | // @match *://*.jianshu.com/* 15 | // @match *://www.zhihu.com/question/* 16 | // @match *://zhuanlan.zhihu.com/p/* 17 | // @match *://jingyan.baidu.com/article* 18 | // @match *://zhidao.baidu.com/question* 19 | // @match *://baike.baidu.com/item/* 20 | // @match *://tieba.baidu.com/p* 21 | // @match *://wk.baidu.com/view/* 22 | // @match *://tanbi.baidu.com/h5apptopic/browse/* 23 | // @match *://baijiahao.baidu.com/s* 24 | // @match *://easylearn.baidu.com/edu-page/* 25 | // @match *://mbd.baidu.com/newspage/data/* 26 | // @match *://news.baidu.com/news* 27 | // @match *://m.baidu.com/sf_baijiahao/* 28 | // @match *://*.sina.cn/* 29 | // @match *://3g.163.com/* 30 | // @match *://*.sohu.com/a/* 31 | // @match *://view.inews.qq.com/* 32 | // @match *://*.ifeng.com/* 33 | // @match *://m.thepaper.cn/newsDetail_forward* 34 | // @match *://m.bjnews.com.cn/detail/* 35 | // @match *://*.huanqiu.com/article/* 36 | // @match *://3w.huanqiu.com/a/* 37 | // @match *://3g.china.com/act/* 38 | // @match *://m.toutiao.com/article/* 39 | // @match *://mini.eastday.com/* 40 | // @match *://*.dxy.cn/* 41 | // @match *://www.cn-healthcare.com/* 42 | // @match *://m.youlai.cn/* 43 | // @match *://space.bilibili.com/*/dynamic* 44 | // @match *://t.bilibili.com/* 45 | // @match *://www.bilibili.com/read/mobile* 46 | // @match *://m.bilibili.com/opus/* 47 | // @match *://weibo.com/ttarticle/p/show?id=* 48 | // @match *://card.weibo.com/article/m/show/id* 49 | // @match *://*.douban.com/* 50 | // @match *://www.oschina.net/p/* 51 | // @match *://developer.aliyun.com/article/* 52 | // @match *://cloud.tencent.com/developer/article/* 53 | // @match *://cloud.tencent.com/developer/beta/article/* 54 | // @match *://huaweicloud.csdn.net/* 55 | // @match *://www.360doc.cn/article/* 56 | // @match *://www.360doc.com/content/* 57 | // @match *://g.pconline.com.cn/x/* 58 | // @match *://m.zol.com.cn/article/* 59 | // @match *://m.autohome.com.cn/news/* 60 | // @match *://chejiahao.m.autohome.com.cn/info/* 61 | // @match *://*.cnr.cn/* 62 | // @match *://club.m.autohome.com.cn/bbs/* 63 | // @match *://3g.ali213.net/* 64 | // @match *://wap.gamersky.com/* 65 | // @match *://m.ds.163.com/* 66 | // @match *://wenda.so.com/q/* 67 | // @match *://m.wenda.so.com/q/* 68 | // @match *://n.tianyancha.com/content/* 69 | // @match *://bbs.tianya.cn/m/* 70 | // @match *://wap.eastmoney.com/a/* 71 | // @match *://mguba.eastmoney.com/* 72 | // @match *://emcreative.eastmoney.com/* 73 | // @match *://*.ximalaya.com/* 74 | // @match *://www.gushiwen.cn/* 75 | // @match *://*.it1352.com/* 76 | // @match *://www.taodudu.cc/news/* 77 | // @match *://programmercarl.com/* 78 | // @match *://blog.didispace.com/* 79 | // @match *://*.wang1314.com/doc/* 80 | // @match *://*.k4china.com/* 81 | // @match *://www.tofacebook.com/* 82 | // @run-at document-start 83 | // @icon data:image/png;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAA29JREFUeF7tmMvrT08Yx1/fnViwVcq/gqKQa8gtd0Kyk8Vv81tZKWGByC233JWIwp9iYcPORkT56fl1po5pnjNn5syc6dOZz/Iz1/dr3s9z5pk5Jv6bm7h+KoDqgIkTqCEwcQPUJFhDoIbAxAnUEJi4AepXoIZADYGJE4gJgSPAF+BFYXYngU/AsyH7CAUg4s8B84GNBSGI+DPAAmDzEAghANriDfS9wO0hJxAx9iBwvhFvhu8HbkbM1fsz6BJfAoJL/CAIfRzQJX5MCF3ioyH4AOwGrjQxbxb5Cixy2G0fcCvGhj3GuMS79vEfIH1v9Jjz/y5dADTx/wCfgScjQdDE/wt8dCTiIAgaAE38MeBBI1yyrw3hN3AgoRO2A9eshCcnfwK42+xjvQJBxj70OcEFQMRftGz+C5BcYGfanBD6iDf6DgFXLbHihG3A4y4ILgBbgEeOQWuA147/VwFvrP/FCbK4K0x8hyLtmnj53D13TCD9LwMLW23fAclLnS7QQmCDspAGYRdwJxEEifmzlgN/AiL+npJ35HLWTsy9xPuS4A5lwVAI0t92iOaCUcX7AEh7qBPEivcdTlgHvPJ435Xtu07+aHMtnxdq+/Y+fPcA6RuaEzQIq4G3CoQi4vs4wOx3GfAhIDEuB947nOCCECpeEtslYNDJm731cYDp6xIlbVpOWAG880AoKj7EAUbHWuClwwlble+tC4IMl1J6aaukNVNKzMsJ23lE2pPEvL33EAfEQlipxP4364Y3uvgYB/ggHG6urjZoDYLpJ9fb4wEnL/1PKWt5PjZ/N8c4IDWELvGuhJdM/BAHxELYBDxtnUFR8SkAyBxaYtypWNpAKC4+FQCZZ49SAmsQpIpcAlxwBKzY3nW3P91UqUEx7us8JAfYc2sQQl6PNfHyDpHltSklgC4n9IEgoXHdUdVlE58yBNpukEuRqwbXbowyVuoHud5GlbQ+m3e1p3aAWSukitRs733MGCLcjM0FQObv855QVHyuEGgfTJcTpBaQbJ+kqot1Q04HmD1p7wk/SosfwwEGgvaeYNp7v+HFnrQ2bgwHmLW194Ri4sd0gFY7FBVfAkC7diguvhQAA2Fxinp+aE4YMwcM3WuW8RVAFqwzNGl1wAwdVpatVgdkwTpDk1YHzNBhZdlqdUAWrDM06eQd8Acza/FB2qWb3AAAAABJRU5ErkJggg== 84 | // @grant none 85 | // @license GPL-3.0 86 | // ==/UserScript== 87 | (function () { 88 | "use strict"; 89 | 90 | /** 91 | * 网站列表 92 | * @type {name/url/操作类型} 93 | */ 94 | const websites = [ 95 | { 96 | name: "CSDN", 97 | url: "blog.csdn.net", 98 | handles: [ 99 | //PC端:自动展开代码块 100 | { 101 | type: "click", 102 | item: ".hide-preCode-bt", 103 | }, 104 | //PC端:关注博主即可阅读全文 105 | { 106 | type: "display", 107 | item: ".hide-article-box", 108 | }, 109 | //阅读全文 110 | { 111 | type: "display", 112 | item: ".btn_mod", 113 | }, 114 | { 115 | type: "height", 116 | item: ".article_content", 117 | }, 118 | { 119 | type: "display", 120 | item: ".readall_box", 121 | }, 122 | //展开评论 123 | { 124 | type: "click", 125 | item: ".btn_comment_readmore", 126 | }, 127 | ], 128 | }, 129 | { 130 | name: "CSDN问答", 131 | url: "ask.csdn.net/questions", 132 | handles: [ 133 | //PC端:展开全部 134 | { 135 | type: "display", 136 | item: ".expandBtn", 137 | }, 138 | { 139 | type: "height", 140 | item: ".normal-style", 141 | }, 142 | //PC端:查看等多回答 143 | { 144 | type: "click", 145 | item: ".ic_ask_down_reeow", 146 | }, 147 | ], 148 | }, 149 | { 150 | name: "CSDN下载", 151 | url: "download.csdn.net/download", 152 | handles: [ 153 | { 154 | type: "click", 155 | item: ".fl", 156 | }, 157 | //展开全部 158 | { 159 | type: "click", 160 | item: ".unfold-font", 161 | }, 162 | //查看更多 163 | { 164 | type: "click", 165 | item: ".el-button--text", 166 | }, 167 | ], 168 | }, 169 | { 170 | name: "CSDN文库", 171 | url: "wenku.csdn.net/answer/", 172 | handles: [ 173 | //展开全部 174 | { 175 | type: "click", 176 | item: ".text-all", 177 | }, 178 | ], 179 | }, 180 | { 181 | name: "it1352", 182 | url: "it1352.com", 183 | handles: [ 184 | //PC端:查看全文:解除公众号限制 185 | { 186 | type: "display", 187 | item: ".arc-body-main-more", 188 | }, 189 | { 190 | type: "height", 191 | item: ".arc-body-main", 192 | }, 193 | ], 194 | }, 195 | { 196 | name: "编程之家", 197 | url: "jb51.cc", 198 | handles: [ 199 | //PC端:阅读全文 200 | { 201 | type: "display", 202 | item: "#read-more-wrap", 203 | }, 204 | { 205 | type: "height", 206 | item: "#container", 207 | }, 208 | //展开 209 | { 210 | type: "height", 211 | item: ".read-more-hidden", 212 | }, 213 | ], 214 | }, 215 | { 216 | name: "简书", 217 | url: "jianshu.com/p", 218 | handles: [ 219 | //阅读全文 220 | { 221 | type: "display", 222 | item: ".collapse-tips", 223 | }, 224 | { 225 | type: "height", 226 | item: ".collapse-free-content", 227 | }, 228 | //允许滑动 229 | { 230 | type: "overflow", 231 | item: "body", 232 | }, 233 | ], 234 | //删除遮挡栏 235 | fun: function () { 236 | let css = document.createElement("style"); 237 | css.innerText = ".collapse-free-content::after {height: 0px !important}"; 238 | document.head.appendChild(css); 239 | }, 240 | }, 241 | { 242 | name: "知乎", 243 | url: "www.zhihu.com/question", 244 | handles: [ 245 | { 246 | type: "display", 247 | item: ".ContentItem-rightButton", 248 | }, 249 | { 250 | type: "height", 251 | item: ".RichContent-inner--collapsed", 252 | }, 253 | ], 254 | fun: function () { 255 | let css = document.createElement("style"); 256 | //空白遮挡 257 | css.innerText += ".RichContent--unescapable.is-collapsed .RichContent-inner {mask-image: unset !important;}"; 258 | //点击按钮 259 | css.innerText += ".RichContent.is-collapsed {cursor: unset !important;}"; 260 | document.head.append(css); 261 | }, 262 | }, 263 | { 264 | name: "百度经验", 265 | url: "jingyan.baidu.com/article", 266 | handles: [ 267 | //PC端:展开内容 268 | { 269 | type: "display", 270 | item: ".read-whole-mask", 271 | }, 272 | { 273 | type: "height", 274 | item: ".exp-content-container", 275 | }, 276 | //展开内容 277 | { 278 | type: "click", 279 | item: ".more-img-opt", 280 | }, 281 | ], 282 | }, 283 | { 284 | name: "百度知道", 285 | url: "zhidao.baidu.com/question", 286 | handles: [ 287 | //展开剩余 288 | { 289 | type: "display", 290 | item: ".w-detail-display-btn", 291 | }, 292 | { 293 | type: "height", 294 | item: ".w-detail-container", 295 | }, 296 | //PC端:展开全部(1) 297 | { 298 | type: "display", 299 | item: ".wgt-best-mask", 300 | }, 301 | { 302 | type: "height", 303 | item: ".best-text", 304 | }, 305 | //PC端:展开全部(2) 306 | { 307 | type: "display", 308 | item: ".wgt-answers-mask", 309 | }, 310 | { 311 | type: "height", 312 | item: ".answer-text", 313 | }, 314 | //PC端:更多回答1 315 | { 316 | type: "display", 317 | item: "#show-hide-container", 318 | }, 319 | { 320 | type: "classList", 321 | item: ".answer", 322 | remove: "answer-hide", 323 | }, 324 | //PC端:更多回答2 325 | { 326 | type: "display", 327 | item: ".show-answer-dispute", 328 | }, 329 | { 330 | type: "classList", 331 | item: ".answer", 332 | remove: "answer-dispute-hide", 333 | }, 334 | ], 335 | }, 336 | { 337 | name: "百度百科", 338 | url: "baike.baidu.com/item", 339 | handles: [ 340 | //展开全部 341 | { 342 | type: "click", 343 | item: ".layout-icons_down-arrow", 344 | }, 345 | //点击加载更多 346 | { 347 | type: "display", 348 | item: "#ui_refresh_down", 349 | }, 350 | ], 351 | fun: function () { 352 | //点击加载更多 353 | let button = document.querySelector(".yx-load-more-inner"); 354 | button.dispatchEvent(new Event("tap")); 355 | }, 356 | }, 357 | { 358 | name: "百度贴吧", 359 | url: "tieba.baidu.com/p", 360 | handles: [ 361 | //PC端:自动展开图片 362 | { 363 | type: "display", 364 | item: ".replace_tip", 365 | }, 366 | { 367 | type: "height", 368 | item: ".replace_div", 369 | }, 370 | //PC端:自动展开回复 371 | { 372 | type: "click", 373 | item: ".j_lzl_m", 374 | }, 375 | ], 376 | }, 377 | { 378 | name: "百度文库手机版1", 379 | url: "wk.baidu.com/view", 380 | handles: [ 381 | //自动展开 382 | { 383 | type: "height", 384 | item: ".reader-copy", 385 | }, 386 | { 387 | //透明遮挡 388 | type: "display", 389 | item: ".blur-bg", 390 | }, 391 | ], 392 | fun: function () { 393 | //工具相关内容下移,避免遮挡 394 | let item = document.querySelector(".fold-pager"); 395 | if (item) { 396 | item.style.setProperty("margin-top", "0px"); 397 | } 398 | }, 399 | }, 400 | { 401 | name: "百度文库手机版2", 402 | url: "tanbi.baidu.com/h5apptopic/browse/", 403 | handles: [ 404 | { 405 | //下载app,继续阅读 406 | type: "display", 407 | item: ".continue-read-wrap", 408 | }, 409 | ], 410 | fun: function () { 411 | let item = document.querySelector("#read-view"); 412 | item.setAttribute("scrolling", "yes"); 413 | }, 414 | }, 415 | { 416 | name: "百家题库", 417 | url: "easylearn.baidu.com/edu-page/", 418 | handles: [ 419 | //阅读全文 420 | { 421 | type: "display", 422 | item: ".shiti-answer .mask", 423 | }, 424 | { 425 | type: "height", 426 | item: ".shiti-answer .analysis-text", 427 | }, 428 | // 显示完整题目 429 | { 430 | type: "height", 431 | item: ".question-cont .tigan", 432 | }, 433 | // 移除遮罩 434 | { 435 | type: "height", 436 | item: ".question-cont .tigan .mask", 437 | }, 438 | ], 439 | }, 440 | { 441 | name: "百家号", 442 | url: "baijiahao.baidu.com/s", 443 | handles: [ 444 | //阅读全文 445 | { 446 | type: "display", 447 | item: ".oPadding", 448 | }, 449 | { 450 | type: "height", 451 | item: ".mainContent", 452 | }, 453 | //点击展开全文:狐猴浏览器特有bug 454 | { 455 | type: "height", 456 | item: "#mainContentContainer", 457 | }, 458 | { 459 | type: "display", 460 | item: ".foldMaskWrapper", 461 | }, 462 | ], 463 | }, 464 | { 465 | name: "百度新闻", 466 | url: "mbd.baidu.com/newspage/data", 467 | handles: [ 468 | //打开百度app:普通新闻 469 | { 470 | type: "display", 471 | item: "[class^=foldMaskWrapper-]", 472 | }, 473 | { 474 | type: "height", 475 | item: "#dynamicItem", 476 | }, 477 | //打开百度app:百度首页 478 | { 479 | type: "display", 480 | item: ".foldMaskWrapper", 481 | }, 482 | { 483 | type: "height", 484 | item: "#mainContentContainer", 485 | }, 486 | ], 487 | }, 488 | { 489 | name: "新浪新闻", 490 | url: "sina.cn", 491 | handles: [ 492 | //展开 493 | { 494 | type: "display", 495 | item: ".look_more", 496 | }, 497 | { 498 | type: "height", 499 | item: ".s_card", 500 | }, 501 | ], 502 | }, 503 | { 504 | name: "网易新闻", 505 | url: "3g.163.com", 506 | handles: [ 507 | //展开 508 | { 509 | type: "display", 510 | item: ".show_article", 511 | }, 512 | { 513 | type: "height", 514 | item: "article", 515 | }, 516 | ], 517 | }, 518 | { 519 | name: "搜狐新闻", 520 | url: "sohu.com/a", 521 | handles: [ 522 | { 523 | type: "display", 524 | item: ".lookall-box", 525 | }, 526 | { 527 | type: "height", 528 | item: "#mp-editor", 529 | }, 530 | ], 531 | fun: function () { 532 | onload = function () { 533 | let item = document.querySelector("#artLookAll"); 534 | item.click(); 535 | clearInterval(interval); 536 | }; 537 | }, 538 | }, 539 | { 540 | name: "腾讯新闻", 541 | url: "view.inews.qq.com/", 542 | handles: [ 543 | //点击展开全文 544 | { 545 | type: "display", 546 | item: "[class^=show-more_outer__]", 547 | }, 548 | { 549 | type: "display", 550 | item: "[class^=show-more-article_cover__]", 551 | }, 552 | { 553 | type: "height", 554 | item: "[class^=show-more_height-not-full__]", 555 | }, 556 | ], 557 | }, 558 | { 559 | name: "凤凰新闻", 560 | url: "ifeng.com/", 561 | handles: [ 562 | //点击展开全文(新闻) 563 | { 564 | type: "display", 565 | item: "[class^=index_more_]", 566 | }, 567 | { 568 | type: "display", 569 | item: "[class^=index_tip_", 570 | }, 571 | { 572 | type: "height", 573 | item: "[class^=index_main_content_]", 574 | }, 575 | 576 | //点击查看完整内容(房产) 577 | { 578 | type: "display", 579 | item: ".showall", 580 | }, 581 | { 582 | type: "height", 583 | item: ".article", 584 | }, 585 | //展开全文(汽车) 586 | { 587 | type: "display", 588 | item: "[class^=more]", 589 | }, 590 | { 591 | type: "height", 592 | item: "[class^=main_content]", 593 | }, 594 | //展开(视频简介) 595 | { 596 | type: "click", 597 | item: "[class^=index_videoBrefTextBtn_]", 598 | }, 599 | ], 600 | }, 601 | { 602 | name: "澎湃新闻", 603 | url: "m.thepaper.cn/newsDetail_forward", 604 | handles: [ 605 | //展开全文 606 | { 607 | type: "display", 608 | item: "#clickForMore", 609 | }, 610 | { 611 | type: "height", 612 | item: ".newsdetail_body", 613 | }, 614 | ], 615 | }, 616 | { 617 | name: "新京报", 618 | url: "m.bjnews.com.cn/detail/", 619 | handles: [ 620 | //展开全文 621 | { 622 | type: "display", 623 | item: ".shade", 624 | }, 625 | { 626 | type: "height", 627 | item: ".article", 628 | }, 629 | ], 630 | }, 631 | { 632 | name: "央广网", 633 | url: "cnr.cn", 634 | handles: [ 635 | //展开全文 636 | { 637 | type: "display", 638 | item: "#readmore", 639 | }, 640 | { 641 | type: "height", 642 | item: "#perny-main", 643 | }, 644 | ], 645 | }, 646 | { 647 | name: "环球网1", 648 | url: "huanqiu.com/article/", 649 | handles: [ 650 | //展开全文 651 | { 652 | type: "click", 653 | item: ".unfold-btn", 654 | }, 655 | ], 656 | }, 657 | { 658 | name: "环球网2", 659 | url: "3w.huanqiu.com/a/", 660 | handles: [ 661 | //展开全文 662 | { 663 | type: "click", 664 | item: "#more", 665 | }, 666 | ], 667 | }, 668 | { 669 | name: "中华网", 670 | url: "3g.china.com/act/", 671 | handles: [ 672 | //点击查看全文(剩余n%) 673 | { 674 | type: "display", 675 | item: "#js-continue-reading", 676 | }, 677 | { 678 | type: "height", 679 | item: "#artiCon", 680 | }, 681 | ], 682 | }, 683 | { 684 | name: "今日头条:移动版", 685 | url: "m.toutiao.com/article/", 686 | handles: [ 687 | //点击查看完整内容 688 | { 689 | type: "display", 690 | item: ".toggle-button-container", 691 | }, 692 | { 693 | type: "display", 694 | item: ".content-shadow", 695 | }, 696 | { 697 | type: "height", 698 | item: ".content", 699 | }, 700 | ], 701 | }, 702 | { 703 | name: "东方资讯", 704 | url: "mini.eastday.com/", 705 | handles: [ 706 | //查看全文 707 | { 708 | type: "display", 709 | item: ".Unfolded-btn", 710 | }, 711 | { 712 | type: "height", 713 | item: ".article-content", 714 | }, 715 | ], 716 | }, 717 | { 718 | name: "丁香园", 719 | url: "dxy.cn", 720 | handles: [ 721 | //显示第一条评论 722 | { 723 | type: "height", 724 | item: ".dicussion-text", 725 | }, 726 | //展开阅读全文 727 | { 728 | type: "display", 729 | item: "[class^=contentWrapBottom___]", 730 | }, 731 | { 732 | type: "height", 733 | item: "[class^=contentWrap___]", 734 | }, 735 | //机构号:展开阅读全文 736 | { 737 | type: "display", 738 | item: ".show-all", 739 | }, 740 | { 741 | type: "height", 742 | item: ".article__content", 743 | }, 744 | ], 745 | }, 746 | { 747 | name: "健康界", 748 | url: "www.cn-healthcare.com/", 749 | handles: [ 750 | //阅读全文 751 | { 752 | type: "display", 753 | item: ".mask", 754 | }, 755 | { 756 | type: "height", 757 | item: "#artbody", 758 | }, 759 | ], 760 | }, 761 | { 762 | name: "有来医生", 763 | url: "m.youlai.cn/", 764 | handles: [ 765 | //阅读全文 766 | { 767 | type: "display", 768 | item: ".showBtn--nqouA", 769 | }, 770 | { 771 | type: "height", 772 | item: ".show-more", 773 | }, 774 | ], 775 | }, 776 | { 777 | name: "B站动态", 778 | url: "space.bilibili.com/", 779 | handles: [], 780 | fun: function () { 781 | //PC端展开简介 782 | let item1s = document.querySelectorAll(".folded"); 783 | for (let item of item1s) { 784 | item.className = "bili-rich-text__content"; 785 | } 786 | let item2s = document.querySelectorAll(".bili-rich-text__action"); 787 | for (let item2 of item2s) { 788 | item2.innerText = "收起"; 789 | } 790 | }, 791 | }, 792 | { 793 | name: "B站专栏", 794 | url: "m.bilibili.com/opus/", 795 | handles: [ 796 | //展开阅读全文 797 | { 798 | type: "display", 799 | item: ".opus-read-more", 800 | }, 801 | { 802 | type: "classList", 803 | item: ".opus-module-content", 804 | remove: "limit", 805 | }, 806 | { 807 | type: "classList", 808 | item: ".opus-module-content", 809 | remove: "show-read-text", 810 | }, 811 | ], 812 | }, 813 | { 814 | name: "微博文章PC版", 815 | url: "weibo.com/ttarticle/p/show?id=", 816 | handles: [ 817 | { 818 | type: "height", 819 | item: ".WB_editor_iframe_new", 820 | }, 821 | { 822 | type: "display", 823 | item: ".btn_line", 824 | }, 825 | ], 826 | }, 827 | { 828 | name: "豆瓣", 829 | url: "douban.com", 830 | handles: [ 831 | //点击展开全文 832 | { 833 | type: "display", 834 | item: ".oia-readall", 835 | }, 836 | { 837 | type: "height", 838 | item: ".note-content", 839 | }, 840 | ], 841 | fun: function () { 842 | //展开(简介) 843 | let item1 = document.querySelector(".subject-intro p"); 844 | try { 845 | let str = item1.getAttribute("data-content"); 846 | if (str) { 847 | item1.innerText = str; 848 | } 849 | } catch (error) { 850 | /* empty */ 851 | } 852 | onload = function () { 853 | //展开(评论) 854 | let items2 = document.querySelectorAll(".LinesEllipsis-readmore"); 855 | for (let item of items2) { 856 | item.click(); 857 | } 858 | 859 | //展开(PC端:评论;简介;人物简介) 860 | let items3 = document.querySelectorAll(".expand,.a_show_full,.fold-switch"); 861 | for (let item of items3) { 862 | item.click(); 863 | } 864 | }; 865 | }, 866 | }, 867 | { 868 | name: "开源中国", 869 | url: "www.oschina.net/p/", 870 | handles: [ 871 | //展开阅读全文 872 | { 873 | type: "display", 874 | item: ".collapse-bar", 875 | }, 876 | { 877 | type: "height", 878 | item: ".article-detail", 879 | }, 880 | ], 881 | }, 882 | { 883 | name: "阿里云开发者社区", 884 | url: "developer.aliyun.com/article", 885 | handles: [ 886 | //关注 887 | { 888 | type: "height", 889 | item: ".article-hide-content", 890 | }, 891 | { 892 | type: "display", 893 | item: ".article-hide-box", 894 | }, 895 | ], 896 | }, 897 | { 898 | name: "腾讯云开发者社区", 899 | url: "cloud.tencent.com/developer/article/", 900 | handles: [ 901 | //旧版:展开阅读全文 902 | { 903 | type: "height", 904 | item: ".com-markdown-collpase-main", 905 | }, 906 | { 907 | type: "display", 908 | item: ".com-markdown-collpase-toggle", 909 | }, 910 | //新版:展开阅读全文 911 | { 912 | type: "height", 913 | item: ".cdc-expand-area__main", 914 | }, 915 | { 916 | type: "display", 917 | item: ".cdc-expand-area__toggle", 918 | }, 919 | ], 920 | }, 921 | { 922 | name: "华为云开发者社区", 923 | url: "huaweicloud.csdn.net/", 924 | handles: [ 925 | //展开阅读全文 926 | { 927 | type: "height", 928 | item: ".user-article", 929 | }, 930 | { 931 | type: "display", 932 | item: ".article-show-more", 933 | }, 934 | ], 935 | }, 936 | { 937 | name: "360图书馆手机版", 938 | url: "www.360doc.cn/article/", 939 | handles: [ 940 | //移动版:展开剩余内容 941 | { 942 | type: "display", 943 | item: ".article_showall", 944 | }, 945 | { 946 | type: "height", 947 | item: ".article", 948 | }, 949 | ], 950 | }, 951 | { 952 | name: "360图书馆PC版", 953 | url: "www.360doc.com/content/", 954 | handles: [ 955 | { 956 | type: "classList", 957 | item: "body", 958 | remove: "articleMaxH", 959 | }, 960 | ], 961 | }, 962 | { 963 | name: "太平洋电脑网", 964 | url: "g.pconline.com.cn/x/", 965 | handles: [ 966 | //展开全文 967 | { 968 | type: "display", 969 | item: ".show_article", 970 | }, 971 | { 972 | type: "height", 973 | item: ".art-content", 974 | }, 975 | ], 976 | }, 977 | { 978 | name: "中关村在线", 979 | url: "m.zol.com.cn/article/", 980 | handles: [ 981 | //展开全文 982 | { 983 | type: "display", 984 | item: ".unfold-article-btn", 985 | }, 986 | { 987 | type: "height", 988 | item: ".article-content", 989 | }, 990 | ], 991 | }, 992 | { 993 | name: "汽车之家:新闻", 994 | url: "m.autohome.com.cn/news/", 995 | handles: [ 996 | //点击展开剩余部分 997 | { 998 | type: "display", 999 | item: "#continue_reading", 1000 | }, 1001 | { 1002 | type: "classList", 1003 | item: "#content .fn-hide", 1004 | remove: "fn-hide", 1005 | }, 1006 | ], 1007 | }, 1008 | { 1009 | name: "汽车之家:车家号", 1010 | url: "chejiahao.m.autohome.com.cn/info/", 1011 | handles: [ 1012 | //点击展开剩余部分 1013 | { 1014 | type: "display", 1015 | item: "#continue_reading_new", 1016 | }, 1017 | { 1018 | type: "classList", 1019 | item: ".pgc-details .fn-hide", 1020 | remove: "fn-hide", 1021 | }, 1022 | ], 1023 | }, 1024 | { 1025 | name: "汽车之家:论坛", 1026 | url: "club.m.autohome.com.cn/bbs/", 1027 | handles: [ 1028 | //点击展开剩余部分 1029 | { 1030 | type: "display", 1031 | item: "#continue_reading", 1032 | }, 1033 | { 1034 | type: "height", 1035 | item: "#topicContentSection", 1036 | }, 1037 | { 1038 | type: "classList", 1039 | item: "#topicContentSection .fn-hide", 1040 | remove: "fn-hide", 1041 | }, 1042 | ], 1043 | }, 1044 | { 1045 | name: "游侠网", 1046 | url: "3g.ali213.net", 1047 | handles: [ 1048 | //阅读全文 1049 | { 1050 | type: "display", 1051 | item: ".read-all-con", 1052 | }, 1053 | { 1054 | type: "display", 1055 | item: ".read-all-con2", 1056 | }, 1057 | { 1058 | type: "height", 1059 | item: ".detail-content", 1060 | }, 1061 | ], 1062 | }, 1063 | { 1064 | name: "游民星空", 1065 | url: "wap.gamersky.com/", 1066 | handles: [ 1067 | //展开全文 1068 | { 1069 | type: "display", 1070 | item: ".gsAreaContextOpen", 1071 | }, 1072 | { 1073 | type: "height", 1074 | item: "#gsAreaContext", 1075 | }, 1076 | ], 1077 | }, 1078 | { 1079 | name: "网易大神", 1080 | url: "m.ds.163.com/", 1081 | handles: [ 1082 | //展开全文 1083 | { 1084 | type: "display", 1085 | item: ".feed-page-main-controller", 1086 | }, 1087 | { 1088 | type: "height", 1089 | item: ".feed-page__main-content", 1090 | }, 1091 | ], 1092 | }, 1093 | { 1094 | name: "360文档", 1095 | url: "wenda.so.com/q/", 1096 | handles: [ 1097 | //PC端:展开问答 1098 | { 1099 | type: "display", 1100 | item: ".answer-part__has-folder__btn", 1101 | }, 1102 | { 1103 | type: "height", 1104 | item: ".answer-part__has-folder", 1105 | }, 1106 | //PC端:更多回答 1107 | { 1108 | type: "display", 1109 | item: ".js-unfold-page", 1110 | }, 1111 | { 1112 | type: "classList", 1113 | item: ".hide.js-unfold-answer.answer-fold-box", 1114 | remove: "hide", 1115 | }, 1116 | //展开完整答案 1117 | { 1118 | type: "display", 1119 | item: ".overflow-cover", 1120 | }, 1121 | { 1122 | type: "height", 1123 | item: ".max-height", 1124 | }, 1125 | //更多回答 1126 | { 1127 | type: "display", 1128 | item: ".js-rest-icon", 1129 | }, 1130 | { 1131 | type: "classList", 1132 | item: ".ans-box.hide", 1133 | remove: "hide", 1134 | }, 1135 | ], 1136 | }, 1137 | { 1138 | name: "天眼查", 1139 | url: "n.tianyancha.com/content", 1140 | handles: [ 1141 | //展开剩余内容 1142 | { 1143 | type: "display", 1144 | item: "[class^=index_other-content-more__]", 1145 | }, 1146 | { 1147 | type: "height", 1148 | item: "[class^=index_other-content-container__]", 1149 | }, 1150 | ], 1151 | }, 1152 | { 1153 | name: "天涯社区", 1154 | url: "bbs.tianya.cn/m/", 1155 | handles: [ 1156 | //点击展开完整贴文 1157 | { 1158 | type: "display", 1159 | item: ".openFullPost", 1160 | }, 1161 | { 1162 | type: "height", 1163 | item: ".onhide", 1164 | }, 1165 | ], 1166 | //删除透明遮挡 1167 | fun: function () { 1168 | let css = document.createElement("style"); 1169 | css.innerHTML = ".item-lz .bd.onhide:before{content:none}"; 1170 | document.head.append(css); 1171 | }, 1172 | }, 1173 | { 1174 | name: "新浪财经", 1175 | url: "cj.sina.cn/article", 1176 | handles: [ 1177 | //打开app阅读全文 1178 | { 1179 | type: "display", 1180 | item: ".read-unfold-box", 1181 | }, 1182 | { 1183 | type: "height", 1184 | item: ".main-article-body", 1185 | }, 1186 | ], 1187 | }, 1188 | { 1189 | name: "东方财富网", 1190 | url: "wap.eastmoney.com/a/", 1191 | handles: [ 1192 | //点击展开完整贴文 1193 | { 1194 | type: "display", 1195 | item: ".fold-btn", 1196 | }, 1197 | { 1198 | type: "display", 1199 | item: ".fold-arrow", 1200 | }, 1201 | { 1202 | type: "height", 1203 | item: "#articleContent", 1204 | }, 1205 | //删除透明遮挡 1206 | { 1207 | type: "display", 1208 | item: ".fold-mask", 1209 | }, 1210 | ], 1211 | }, 1212 | { 1213 | name: "东方财富网:社区", 1214 | url: "emcreative.eastmoney.com/", 1215 | handles: [ 1216 | //点击阅读全文 1217 | { 1218 | type: "display", 1219 | item: ".my_ad_wrap", 1220 | }, 1221 | { 1222 | type: "height", 1223 | item: "#text-content", 1224 | }, 1225 | ], 1226 | }, 1227 | { 1228 | name: "东方财富网:股吧", 1229 | url: "mguba.eastmoney.com/", 1230 | handles: [ 1231 | //点击阅读全文 1232 | { 1233 | type: "display", 1234 | item: "#foldup_box", 1235 | }, 1236 | { 1237 | type: "height", 1238 | item: "#content", 1239 | }, 1240 | ], 1241 | }, 1242 | { 1243 | name: "喜马拉雅", 1244 | url: "www.ximalaya.com/", 1245 | handles: [ 1246 | //简介 1247 | { 1248 | type: "display", 1249 | item: ".more-intro-wrapper", 1250 | }, 1251 | { 1252 | type: "height", 1253 | item: ".layout-main div>article", 1254 | }, 1255 | ], 1256 | }, 1257 | { 1258 | name: "喜马拉雅", 1259 | url: "m.ximalaya.com/", 1260 | handles: [ 1261 | //简介+评论 1262 | { 1263 | type: "height", 1264 | item: ".stretch-box", 1265 | }, 1266 | ], 1267 | fun: function () { 1268 | onload = function () { 1269 | let item1 = document.querySelector(".stretch-more"); 1270 | let item2 = item1.parentElement; 1271 | item2.remove(); 1272 | }; 1273 | }, 1274 | }, 1275 | { 1276 | name: "古诗文网", 1277 | url: "www.gushiwen.cn/", 1278 | handles: [], 1279 | fun: function () { 1280 | let item1s = document.evaluate("//a[contains(text(), '阅读全文')]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); 1281 | for (let i = 0; i < item1s.snapshotLength; i++) { 1282 | item1s.snapshotItem(i).click(); 1283 | } 1284 | clearInterval(interval); 1285 | }, 1286 | }, 1287 | { 1288 | name: "淘嘟嘟", 1289 | url: "www.taodudu.cc/news/", 1290 | handles: [ 1291 | //阅读全文,人机检测 1292 | { 1293 | type: "display", 1294 | item: "#vip", 1295 | }, 1296 | { 1297 | type: "height", 1298 | item: "#article_content", 1299 | }, 1300 | ], 1301 | }, 1302 | { 1303 | name: "代码随想录", 1304 | url: "programmercarl.com/", 1305 | handles: [ 1306 | //阅读全文 1307 | { 1308 | type: "display", 1309 | item: "#read-more-wrap", 1310 | }, 1311 | { 1312 | type: "height", 1313 | item: "#container", 1314 | }, 1315 | ], 1316 | }, 1317 | { 1318 | name: "程序猿DD", 1319 | url: "blog.didispace.com", 1320 | handles: [ 1321 | //阅读全文,人机检测 1322 | { 1323 | type: "display", 1324 | item: "#read-more-wrap", 1325 | }, 1326 | { 1327 | type: "height", 1328 | item: ".article", 1329 | }, 1330 | ], 1331 | }, 1332 | { 1333 | name: "好网角收藏夹", 1334 | url: "wang1314.com/doc", 1335 | handles: [ 1336 | //PC端:阅读全文,人机检测 1337 | { 1338 | type: "display", 1339 | item: "#show_content_bar", 1340 | }, 1341 | { 1342 | type: "height", 1343 | item: "#art_body", 1344 | }, 1345 | //阅读原文全部内容 1346 | { 1347 | type: "display", 1348 | item: "#show_content_bar", 1349 | }, 1350 | { 1351 | type: "height", 1352 | item: "#body_content", 1353 | }, 1354 | ], 1355 | }, 1356 | { 1357 | name: "科中资源网", 1358 | url: "k4china.com", 1359 | handles: [ 1360 | //点击阅读全文 1361 | { 1362 | type: "click", 1363 | item: ".readmore", 1364 | }, 1365 | ], 1366 | }, 1367 | { 1368 | name: "tofacebook", 1369 | url: "www.tofacebook.com", 1370 | handles: [ 1371 | //阅读全部 1372 | { 1373 | type: "height", 1374 | item: ".panel-default", 1375 | }, 1376 | { 1377 | type: "display", 1378 | item: ".more-box", 1379 | }, 1380 | ], 1381 | }, 1382 | ]; 1383 | let time = 0; 1384 | let interval = setInterval(() => { 1385 | if (++time == 100) { 1386 | clearInterval(interval); 1387 | } 1388 | for (let website of websites) { 1389 | if (location.href.indexOf(website.url) != -1) { 1390 | if (website.fun) { 1391 | website.fun(); 1392 | } 1393 | for (let handle of website.handles) { 1394 | let items = document.querySelectorAll(handle.item); 1395 | if (items.length != 0) { 1396 | if (handle.type == "display") { 1397 | //隐藏遮挡部分 1398 | for (let item of items) { 1399 | item.style.display = "none"; 1400 | } 1401 | } else if (handle.type == "height") { 1402 | //加长内容部分 1403 | for (let item of items) { 1404 | item.style.setProperty("height", "unset", "important"); 1405 | item.style.setProperty("min-height", "unset", "important"); 1406 | item.style.setProperty("max-height", "unset", "important"); 1407 | } 1408 | } else if (handle.type == "overflow") { 1409 | //防止无法滑动 1410 | for (let item of items) { 1411 | item.style.setProperty("overflow", "unset", "important"); 1412 | } 1413 | } else if (handle.type == "classList") { 1414 | //删除className 1415 | for (let item of items) { 1416 | item.classList.remove(handle.remove); 1417 | } 1418 | } else if (handle.type == "click") { 1419 | //模拟一次点击 1420 | for (let item of items) { 1421 | if (item != null && item.getAttribute("opened") != "yes") { 1422 | item.click(); 1423 | item.setAttribute("opened", "yes"); 1424 | } 1425 | } 1426 | } else { 1427 | //模拟多次点击 1428 | for (let item of items) { 1429 | if (item) { 1430 | item.click(); 1431 | } 1432 | } 1433 | } 1434 | } 1435 | } 1436 | } 1437 | } 1438 | }, 100); 1439 | })(); 1440 | -------------------------------------------------------------------------------- /DoubanAssistant.md: -------------------------------------------------------------------------------- 1 | [![GitHub license](https://img.shields.io/github/license/airbashX/UserScript.svg?style=flat-square&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 2 | [![GitHub Star](https://img.shields.io/github/stars/airbashX/UserScript.svg?style=flat-square&label=Star&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 3 | [![GitHub Fork](https://img.shields.io/github/forks/airbashX/UserScript.svg?style=flat-square&label=Fork&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 4 | [![](https://data.jsdelivr.com/v1/package/gh/airbashX/UserScript/badge)](https://www.jsdelivr.com/package/gh/airbashX/UserScript) 5 | [![](https://img.shields.io/static/v1?label=%20&message=GreasyFork&style=flat-square&labelColor=7B0000&color=960000&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII=)](https://greasyfork.org/zh-CN/users/698573-厌学的骚年) 6 | 7 | # 相关功能: 8 | 9 | 1. 自动抓取IMDB评分 10 | 11 | 2. 恢复点击豆瓣中IMDB电影编号跳转到IMDB的功能; 12 | 13 | 3. 自动校验和快捷搜索6v电影网、电影天堂、新电影天堂、WebHD、rargb、海盗湾、watchsomuch、EXT、tgx资源的功能; 14 | 15 | 4. 增加快捷搜索SubHD、字幕库、射手网、opensubtitle中字幕的功能; 16 | 17 | 5. 增加快捷搜索腾讯、优酷、爱奇艺、哔哩哔哩、西瓜视频、欢喜首映中影视的功能; 18 | 19 | ![](https://img.picui.cn/free/2024/09/11/66e1b74a02156.png) 20 | 21 | # 现代化UI 22 | 23 | ![](https://img.picui.cn/free/2024/09/11/66e1b86c5f6e7.png) 24 | 25 | # 增加链接: 26 | |链接|功能|其他功能| 27 | |-|-|---| 28 | |IMDB|✔|显示IMDB评分| 29 | |SubHD|✔|| 30 | |字幕库|✔|| 31 | |射手网|✔|| 32 | |opensubtitle|✔|| 33 | |WebHD|✔|| 34 | |rargb|✔|| 35 | |海盗船|✔|| 36 | |1337X|✔|| 37 | |watchsomuch|✔|| 38 | |tgx|✔|| 39 | |EXT|✔|| 40 | |6v电影|✔|自动验证| 41 | |电影天堂|✔|| 42 | |迅雷电影天堂|✔|| 43 | |腾讯视频|✔|| 44 | |优酷视频|✔|| 45 | |爱奇艺|✔|| 46 | |哔哩哔哩|✔|| 47 | |西瓜视频|✔|| 48 | |欢喜首映|✔|| 49 | 50 | 持续支持中... -------------------------------------------------------------------------------- /DoubanAssistant.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 豆瓣助手 3 | // @version 0.0.20 4 | // @namespace airbash/DoubanAssistant 5 | // @homepageURL https://github.com/AirBashX/UserScript 6 | // @author airbash 7 | // @description 恢复IMDB的链接,展示IMDB评分,以及增加快捷搜索SubHD、字幕库、射手网、opensubtitle、6V电影网、电影天堂、新电影天堂、WebHD、rargb、海盗湾、watchsomuch、tgx、EXT、腾讯视频、优酷视频、爱奇艺、哔哩哔哩、西瓜视频、欢喜首映中资源的功能 8 | // @match *://movie.douban.com/subject/* 9 | // @connect www.hao6v.me 10 | // @connect www.imdb.com 11 | // @connect dy2018.com 12 | // @grant GM_registerMenuCommand 13 | // @grant GM_unregisterMenuCommand 14 | // @grant GM_setValue 15 | // @grant GM_getValue 16 | // @grant GM_xmlhttpRequest 17 | // @grant GM_addStyle 18 | // @license GPL-3.0 19 | // @icon https://img1.doubanio.com/favicon.ico 20 | // @require https://fastly.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js 21 | // @require https://fastly.jsdelivr.net/npm/encode-gb2312@0.0.2/encodeToGb2312.min.js 22 | // @run-at document-end 23 | // ==/UserScript== 24 | /* global encodeToGb2312 Swal*/ 25 | /// 26 | /// 27 | (function () { 28 | // "use strict"; 29 | const url = location.href; 30 | const head = document.head; 31 | 32 | //获取imdbitem 33 | let info_item = document.querySelector("#info"); 34 | let imdb_item = document.evaluate('//span[text()="IMDb:"]', info_item, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; 35 | let imdb_id_item = document.evaluate('//span[text()="IMDb:"]/following::text()[1]', info_item, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; 36 | 37 | //获取imdb_id 38 | let imdb_id = imdb_id_item.textContent.trim(); 39 | 40 | //获取douban_id 41 | let douban_id = url.split("/")[4]; 42 | 43 | //获取douban_cn_name 44 | let douban_cn_name = head.querySelector("title").innerText.slice(9, -6); 45 | //获取GBK编码的douban_cn_name 46 | let douban_cn_name_gbk = encodeToGb2312(douban_cn_name).replace(/(.{2})/gi, "%$1"); 47 | 48 | //获取豆瓣英文名 49 | let douban_en_name = douban_cn_name; 50 | let douban_en_name1s = document.querySelector("#content > h1 > span:nth-child(1)").innerHTML; 51 | let douban_en_name1 = douban_en_name1s.split(douban_cn_name)[1].trim(); 52 | 53 | /** 54 | * 获取备用豆瓣英文名 55 | * 56 | * @return {string} The douban en name 2. 57 | */ 58 | function getDoubanEnName2() { 59 | let douban_items = document.querySelectorAll("#info .pl"); 60 | for (let pl of douban_items) { 61 | if ("又名:" == pl.textContent) { 62 | let movieNames = pl.nextSibling.textContent.trim().split(" / "); 63 | for (let name of movieNames) { 64 | if (/^[a-zA-Z0-9]/.test(name)) { 65 | return name; 66 | } 67 | } 68 | } 69 | } 70 | } 71 | 72 | if (/^[a-zA-Z0-9]/.test(douban_en_name1)) { 73 | douban_en_name = douban_en_name1; 74 | } else { 75 | let doubanEnName = getDoubanEnName2(); 76 | if (doubanEnName) { 77 | douban_en_name = getDoubanEnName2(); 78 | } 79 | } 80 | 81 | /** 82 | * 恢复IMDB链接 83 | */ 84 | function imdb_link() { 85 | let div = document.createElement("div"); 86 | div.innerHTML = "IMDb: " + imdb_id + "
"; 87 | imdb_id_item.after(div); 88 | //删除原本的idmb链接 89 | imdb_item.remove(); 90 | imdb_id_item.remove(); 91 | } 92 | 93 | /** 94 | * 获取IMDB评分 95 | */ 96 | function imdb_score() { 97 | GM_xmlhttpRequest({ 98 | url: "https://www.imdb.com/title/" + imdb_id, 99 | onload: function (response) { 100 | let text = response.responseText; 101 | let dp = new DOMParser(); 102 | let html = dp.parseFromString(text, "text/html"); 103 | let item = html.querySelector("[data-testid=hero-rating-bar__aggregate-rating__score] span"); 104 | let imdb_score = item.innerText; 105 | 106 | let str = html.querySelector("#__NEXT_DATA__").textContent; 107 | let json = JSON.parse(str); 108 | let imdb_vote = json.props.pageProps.aboveTheFoldData.ratingsSummary.voteCount; 109 | 110 | let self = document.querySelector(".rating_self").cloneNode(true); 111 | let logo = document.querySelector(".rating_logo").cloneNode(true); 112 | let sectl = document.querySelector("#interest_sectl"); 113 | sectl.append(logo); 114 | sectl.append(self); 115 | 116 | //增加IMDB名 117 | logo.innerText = "IMDB评分"; 118 | //修改文字评分 119 | self.querySelector(".rating_num").innerText = imdb_score; 120 | //修改图形评分 121 | let classList = self.querySelector(".bigstar").classList; 122 | classList.replace(classList.item(2), "bigstar" + (Math.floor(imdb_score) / 2) * 10); 123 | //修改IMDB人数 124 | self.querySelector(".rating_people span").innerText = imdb_vote; 125 | self.querySelector(".rating_people").href = "https://www.imdb.com/title/" + imdb_id + "/ratings"; 126 | 127 | // let div = document.createElement("div"); 128 | // div.innerHTML = "IMDb评分:" + score + "
"; 129 | // document.querySelector(".rating_wrap").after(div); 130 | }, 131 | }); 132 | } 133 | 134 | /** 135 | * 侧边栏功能列表 136 | */ 137 | const webSites = [ 138 | { 139 | id: "group1", 140 | name: "字幕搜索", 141 | links: [ 142 | { 143 | name: "SubHD", 144 | url: "subhd.tv", 145 | search: "https://subhd.tv/search/" + douban_cn_name, 146 | }, 147 | { 148 | name: "射手网", 149 | url: "assrt.net", 150 | search: "https://assrt.net/sub/?searchword=" + douban_cn_name, 151 | }, 152 | { 153 | name: "字幕库", 154 | url: "zimuku.org", 155 | search: "https://so.zimuku.org/search?q=" + douban_cn_name, 156 | }, 157 | { 158 | name: "OpenSub", 159 | url: "opensubtitles.org", 160 | search: "https://www.opensubtitles.com/zh-CN/zh-CN/search-all/q-" + imdb_id + "/hearing_impaired-include/machine_translated-/trusted_sources-", 161 | }, 162 | ], 163 | }, 164 | { 165 | id: "group2", 166 | name: "英文资源", 167 | links: [ 168 | { 169 | name: "rargb", 170 | url: "rargb.to", 171 | search: "https://rargb.to/search/?search=" + douban_en_name, 172 | }, 173 | { 174 | name: "海盗湾", 175 | url: "thepiratebay10.xyz", 176 | search: "https://thepiratebay10.xyz/search/" + douban_en_name, 177 | }, 178 | { 179 | name: "WSM", 180 | url: "watchsomuch.to", 181 | search: "https://watchsomuch.to/Movies/" + douban_en_name, 182 | }, 183 | { 184 | name: "tgx", 185 | url: "tgx.rs", 186 | search: "https://tgx.rs/torrents.php?search=" + douban_en_name, 187 | }, 188 | { 189 | name: "1377x", 190 | url: "www.1377x.to", 191 | search: "https://www.1377x.to/search/" + douban_en_name + "/1/", 192 | }, 193 | { 194 | name: "EXT", 195 | url: "extranet.torrentbay.st", 196 | search: "https://extranet.torrentbay.st/browse/?q=" + douban_en_name, 197 | }, 198 | ], 199 | }, 200 | { 201 | id: "group3", 202 | name: "中文资源", 203 | links: [ 204 | { 205 | name: "6v电影网", 206 | url: "www.hao6v.tv", 207 | search: "https://www.hao6v.me/e/search/index.php", 208 | data: "show=title%2Csmalltext&tempid=1&keyboard=" + douban_cn_name_gbk + "&tbname=article&x=0&y=0", 209 | type: "xhr", 210 | anonymous: true, 211 | }, 212 | { 213 | name: "电影天堂", 214 | url: "www.dygod.net", 215 | search: "https://www.dygod.net/", 216 | }, 217 | { 218 | name: "新电影天堂", 219 | url: "www.xl720.com", 220 | search: "https://www.xl720.com/?s=" + douban_cn_name, 221 | }, 222 | ], 223 | }, 224 | { 225 | id: "group4", 226 | name: "正版资源", 227 | links: [ 228 | { 229 | name: "腾讯视频", 230 | url: "v.qq.com", 231 | search: "https://v.qq.com/x/search/?q=" + douban_cn_name, 232 | }, 233 | { 234 | name: "优酷视频", 235 | url: "youku.com", 236 | search: "https://so.youku.com/search_video/q_" + douban_cn_name, 237 | }, 238 | { 239 | name: "爱奇艺", 240 | url: "iqiyi.com", 241 | search: "https://so.iqiyi.com/so/q_" + douban_cn_name, 242 | }, 243 | { 244 | name: "哔哩哔哩", 245 | url: "bilibili.com", 246 | search: "https://search.bilibili.com/all?keyword=" + douban_cn_name, 247 | }, 248 | { 249 | name: "西瓜视频", 250 | url: "www.ixigua.com", 251 | search: "https://www.ixigua.com/search/" + douban_cn_name, 252 | }, 253 | { 254 | name: "欢喜首映", 255 | url: "www.huanxi.com", 256 | search: "https://www.huanxi.com/search.shtml?sv=" + douban_cn_name, 257 | }, 258 | ], 259 | }, 260 | ]; 261 | 262 | /** 263 | * 功能列表 264 | */ 265 | const GMValues = [ 266 | { 267 | id: "imdb_link", 268 | name: "IMDB链接", 269 | fun: imdb_link, 270 | }, 271 | { 272 | id: "imdb_score", 273 | name: "IMDB评分", 274 | fun: imdb_score, 275 | }, 276 | ]; 277 | 278 | if (imdb_id) { 279 | for (let GMValue of GMValues) { 280 | if (GM_getValue(GMValue.id, true)) { 281 | GMValue.fun(); 282 | } 283 | } 284 | } 285 | 286 | aside(); 287 | 288 | /** 289 | * 脚本工具菜单 290 | */ 291 | GM_registerMenuCommand("配置", () => { 292 | configuration(); 293 | }); 294 | 295 | /** 296 | * 侧边栏功能 297 | */ 298 | function aside() { 299 | let aside = document.querySelector(".aside"); 300 | for (let webSite of webSites) { 301 | let div = document.createElement("div"); 302 | div.className = "resource"; 303 | if (GM_getValue(webSite.id, true)) { 304 | div.innerHTML = "

" + webSite.name + "· · · · · ·

"; 305 | aside.prepend(div); 306 | let ul = document.createElement("ul"); 307 | ul.className = "resources"; 308 | div.appendChild(ul); 309 | for (let link of webSite.links) { 310 | if (link.type != "xhr") { 311 | let str = '' + link.name + ""; 312 | let a = document.createRange().createContextualFragment(str); 313 | ul.appendChild(a); 314 | } else { 315 | GM_xmlhttpRequest({ 316 | url: link.search, 317 | method: "POST", 318 | headers: { 319 | "Content-Type": "application/x-www-form-urlencoded", 320 | }, 321 | timeout: 5000, 322 | anonymous: link.anonymous, 323 | data: link.data, 324 | onload: function (response) { 325 | //chrome+tm会出现兼容性问题: 326 | let finalUrl = response.finalUrl; 327 | if (finalUrl.search("/index.php/") != -1) { 328 | finalUrl = finalUrl.replace("/index.php", ""); 329 | } 330 | 331 | let str; 332 | if (finalUrl == link.search) { 333 | str = '' + link.name + ""; 334 | } else { 335 | str = '' + link.name + ""; 336 | } 337 | let a = document.createRange().createContextualFragment(str); 338 | ul.appendChild(a); 339 | }, 340 | }); 341 | } 342 | } 343 | } 344 | } 345 | 346 | const resourceStyle = document.createElement("style"); 347 | resourceStyle.innerHTML = 348 | ".resource {margin-bottom: 30px} .resources {padding: 0 12px;*letter-spacing: normal} .resources a {border-radius: 6px;color: #37A;display: inline-block;letter-spacing: normal;margin: 0 8px 8px 0;padding: 0 8px;text-align: center;width: 65px} .resources a:link, .resources a:visited {background-color: #f5f5f5;color: #37A} .resources a:hover, .resources a:active {background-color: #e8e8e8;color: #37A} .resources a.disabled {text-decoration: line-through} .resources a.available {background-color: #5ccccc;color: #006363} .resources a.available:hover, .resources a.available:active {background-color: #3cc} .resources a.honse {background-color: #fff0f5;color: #006363} .resources a.honse:hover, .resources a.honse:active {background-color: #3cc} .resources a.sites_r0 {text-decoration: line-through}"; 349 | document.head.appendChild(resourceStyle); 350 | } 351 | 352 | /** 353 | * 配置 354 | */ 355 | function configuration() { 356 | Swal.fire({ 357 | title: "豆瓣助手 配置", 358 | html: swal_html, 359 | showCloseButton: true, 360 | didRender: () => { 361 | GM_addStyle(` 362 | .swal2-html-container{text-align:left !important;line-height:unset !important;} 363 | .smail_div{width:33%;float:left;} 364 | .switch{float:left;position:relative;top:3px;width:40px;height:20px;display:flex;} 365 | .checkbox{z-index:3;position:relative;width:100%;height:100%;cursor:pointer;opacity:0;} 366 | .bt{z-index:2;position:absolute;top:0;bottom:0;} 367 | .bt:before{position:absolute;top:2.5px;left:2.5px;content:"";width:15px;height:15px;background-color:red;border-radius:50%;transition:0.3s cubic-bezier(0.18,0.89,0.35,1.15) all;} 368 | .checkbox:checked + .bt:before{left:20px;background-color:#03a9f4;} 369 | .bg{z-index:1;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:100px;background-color:#fcebeb;} 370 | .checkbox:checked ~ .bg{background-color:#ebf7fc;}`); 371 | /** 372 | * 侧边栏开关 373 | */ 374 | for (let webSite of webSites) { 375 | if (GM_getValue(webSite.id, true)) { 376 | document.querySelector("#DA_div #" + webSite.id).checked = true; 377 | } 378 | } 379 | if (imdb_id) { 380 | for (let GMValue of GMValues) { 381 | if (GM_getValue(GMValue.id, true)) { 382 | document.querySelector("#DA_div #" + GMValue.id).checked = true; 383 | } 384 | } 385 | } 386 | }, 387 | }).then((result) => { 388 | let change; 389 | if (result.isConfirmed) { 390 | for (let webSite of webSites) { 391 | if (document.querySelector("#DA_div #" + webSite.id).checked != GM_getValue(webSite.id, true)) { 392 | GM_setValue(webSite.id, document.querySelector("#DA_div #" + webSite.id).checked); 393 | change = true; 394 | } 395 | } 396 | if (imdb_id) { 397 | for (let GMValue of GMValues) { 398 | if (document.querySelector("#DA_div #" + GMValue.id).checked != GM_getValue(GMValue.id, true)) { 399 | GM_setValue(GMValue.id, document.querySelector("#DA_div #" + GMValue.id).checked); 400 | change = true; 401 | } 402 | } 403 | } 404 | 405 | if (change) { 406 | location.reload(); 407 | } 408 | } 409 | }); 410 | } 411 | 412 | let swal_html = "
"; 413 | for (let webSite of webSites) { 414 | swal_html += '
' + webSite.name + "
"; 415 | } 416 | for (let GMValue of GMValues) { 417 | swal_html += '
' + GMValue.name + "
"; 418 | } 419 | swal_html += "
"; 420 | })(); 421 | -------------------------------------------------------------------------------- /GptCleaner.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name GPT清理助手 3 | // @namespace airbash/GptCleaner 4 | // @author airbash 5 | // @homepageURL https://github.com/AirBashX/UserScript 6 | // @version 0.0.2 7 | // @description 每次进入gpt页面,删除之前的聊天记录 8 | // @match *://*.aichatos.xyz/* 9 | // @license GPL-3.0 10 | // @run-at document-start 11 | // ==/UserScript== 12 | 13 | (function () { 14 | "use strict"; 15 | localStorage.removeItem("chatStorage"); 16 | })(); -------------------------------------------------------------------------------- /JenkinsAssistant.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Jenkins助手 3 | // @author airbash 4 | // @version 0.0.1 5 | // @namespace airbash/JenkinsAssistant 6 | // @homepageURL https://github.com/AirBashX/UserScript 7 | // @description 过滤健康程度低、不经常更新的jenkins插件 8 | // @match *://plugins.jenkins.io/ui/search* 9 | // @grant GM_addStyle 10 | // @grant GM_getValue 11 | // @grant GM_setValue 12 | // @icon https://www.jenkins.io/favicon.ico 13 | // @run-at document-end 14 | // @license GPL-3.0 15 | // ==/UserScript== 16 | /// 17 | (function () { 18 | "use strict"; 19 | let inter = setInterval(() => { 20 | let CategoryList = document.querySelector(".CategoryList"); 21 | if (CategoryList) { 22 | let li = document.createElement("li"); 23 | li.className = "Other"; 24 | //
25 | li.innerHTML = '
'; 26 | CategoryList.prepend(li); 27 | let health = document.querySelector("[name=health]"); 28 | let display = GM_getValue("display", false); 29 | health.checked = display; 30 | saerchHandler(health) 31 | checkedHandler(health); 32 | health.addEventListener("change", function () { 33 | checkedHandler(health); 34 | }); 35 | clearInterval(inter); 36 | } 37 | }, 10000); 38 | 39 | function saerchHandler(health) { 40 | let button = document.querySelectorAll(".btn-primary"); 41 | button[1].onclick = function () { 42 | health.checked=false; 43 | GM_setValue("display", false); 44 | }; 45 | let items = document.querySelectorAll(".headerContainer label:not(.exclude),[name=showAll]"); 46 | for (let item of items) { 47 | item.onclick=function(){ 48 | health.checked=false; 49 | GM_setValue("display", false); 50 | } 51 | } 52 | 53 | } 54 | 55 | function checkedHandler(health) { 56 | let items = document.querySelectorAll(".SearchResults--ItemBox"); 57 | if (health.checked) { 58 | for (let item of items) { 59 | if (item.querySelector(".bg-warning,.bg-danger")) { 60 | GM_setValue("display", true); 61 | item.style.display = "none"; 62 | } 63 | } 64 | } else { 65 | for (let item of items) { 66 | GM_setValue("display", false); 67 | item.style.display = "unset"; 68 | } 69 | } 70 | } 71 | })(); 72 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /LinkManager.md: -------------------------------------------------------------------------------- 1 | [![GitHub license](https://img.shields.io/github/license/airbashX/UserScript.svg?style=flat-square&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 2 | [![GitHub Star](https://img.shields.io/github/stars/airbashX/UserScript.svg?style=flat-square&label=Star&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 3 | [![GitHub Fork](https://img.shields.io/github/forks/airbashX/UserScript.svg?style=flat-square&label=Fork&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 4 | [![](https://data.jsdelivr.com/v1/package/gh/airbashX/UserScript/badge)](https://www.jsdelivr.com/package/gh/airbashX/UserScript) 5 | [![](https://img.shields.io/static/v1?label=%20&message=GreasyFork&style=flat-square&labelColor=7B0000&color=960000&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII=)](https://greasyfork.org/zh-CN/users/698573-厌学的骚年) 6 | 7 | # 相关功能: 8 | 9 | 1. 绕过搜索引擎(百度、搜狗、360、必应)搜索结果中的重定向链接,直链访问原始网站(受搜索引擎的限制,现在仅支持部分结果); 10 | 2. 删除网站重定向到安全页面,减少操作步骤和响应时间; 11 | 3. 自动跳转中文文档:默认关闭,需要在`Tampermonkey`+`Violentmonkey`+`ScriptCat`+`Via`等油猴插件菜单中开启; 12 | 13 | # 相关脚本: 14 | | 名称 | 功能 | 15 | | :----------- | :----------------------------------------------------------- | 16 | | **[自动展开](https://greasyfork.org/zh-CN/scripts/438656)** | 自动展开文章或新闻等`隐藏`、`折叠`部分 | 17 | | **[骚扰拦截](https://greasyfork.org/zh-CN/scripts/440871)** | 自动拦截`下载弹窗`、`悬浮按钮`、`登录弹窗`等影响用户体验的骚扰元素 | 18 | | **[链接管理](https://greasyfork.org/zh-CN/scripts/443670)** | 取消点击链接后跳转到安全页面 | 19 | | **[移除复制后缀](https://greasyfork.org/zh-CN/scripts/472307)** | 移除复制后附带的`后缀`、`网站声明` | 20 | 21 | # 适配网站: 22 | |网站名|PC|Phone|其他功能| 23 | |-|-|-|-| 24 | |百度搜索|✔|✔|| 25 | |搜狗搜索|✔|✔|| 26 | |360搜索|✔|✔|| 27 | |必应搜索|✔|✔|| 28 | |谷歌搜索|✔|✔|| 29 | |CSDN|✔|✔|| 30 | |简书|✔|✔|| 31 | |掘金|✔|✔|| 32 | |知乎|✔|✔|| 33 | |知乎专栏|✔|✔|| 34 | |百度贴吧|✔|✔|| 35 | |开源中国|✔|✔|| 36 | |gitee|✔|✔|| 37 | |leetcode|✔|✔|| 38 | |51CTO|✔|✔|| 39 | |423down|✔|✔|| 40 | |酷安|✔|✔|| 41 | |eslint文档|✔|✔|跳转中文文档| 42 | |MDN火狐|✔|✔|跳转中文文档| 43 | |微软文档|✔|✔|跳转中文文档| 44 | |tampermonkey|✔|✔|跳转中文文档| 45 | 46 | 感谢:[Maritedo](https://github.com/AirBashX/UserScript/issues/25)对本项目的代码提交 -------------------------------------------------------------------------------- /LinkManager.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 链接管理 3 | // @version 1.3.27 4 | // @namespace airbash/LinkManager 5 | // @homepageURL https://github.com/AirBashX/UserScript 6 | // @author airbash 7 | // @description 绕过搜索引擎(百度、搜狗、360、必应、谷歌)搜索结果中的重定向链接,直链访问原始网站,删除网站重定向到安全页面,自动跳转中文文档,减少操作步骤和响应时间;长期维护、PC+手机全平台支持:CSDN+掘金+简书+知乎+知乎专栏+百度贴吧+开源中国+码云gitee+扣丁leetcode+51CTO+百度搜索+360搜索+搜狗搜索+必应搜索+423down+酷安+eslint+微软文档+火狐MDN+tampermonkey文档; 8 | // @match *://link.csdn.net/* 9 | // @match *://link.juejin.cn/* 10 | // @match *://juejin.cn/* 11 | // @match *://www.jianshu.com/p/* 12 | // @match *://www.jianshu.com/go-wild?* 13 | // @match *://*.zhihu.com/* 14 | // @match *://tieba.baidu.com/* 15 | // @match *://*.oschina.net/* 16 | // @match *://gitee.com/* 17 | // @match *://leetcode.cn/link/* 18 | // @match *://blog.51cto.com/* 19 | // @match *://*.baidu.com/* 20 | // @match *://m.so.com/s?* 21 | // @match *://www.so.com/s?* 22 | // @match *://www.sogou.com/web?* 23 | // @match *://*.bing.com/search* 24 | // @match *://www.423down.com/* 25 | // @match *://www.coolapk.com/link* 26 | // @match *://*.eslint.org/docs/latest/* 27 | // @match *://learn.microsoft.com/* 28 | // @match *://developer.mozilla.org/* 29 | // @match *://www.tampermonkey.net/* 30 | // @icon data:image/png;base64,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 31 | // @grant GM_registerMenuCommand 32 | // @grant GM_setValue 33 | // @grant GM_getValue 34 | // @grant GM_xmlhttpRequest 35 | // @grant GM_info 36 | // @license GPL-3.0 37 | // @run-at document-body 38 | // ==/UserScript== 39 | /// 40 | 41 | (function () { 42 | "use strict"; 43 | 44 | /** 45 | * 安全页面重定向列表 46 | * @type {安全页面网站} 47 | */ 48 | const safePages = [ 49 | { 50 | //https://blog.csdn.net/weixin_50829653/article/details/118119039 51 | //https://link.csdn.net/?from_id=118119039&target=https://baidu.com 52 | name: "CSDN", 53 | url: "link.csdn.net", 54 | handlers: [ 55 | { 56 | type: "forward", 57 | start: "&target=", 58 | }, 59 | ], 60 | }, 61 | { 62 | //https://link.zhihu.com/?target=https://www.apifox.cn/ 63 | name: "知乎", 64 | url: "link.zhihu.com/?target=", 65 | handlers: [ 66 | { 67 | type: "forward", 68 | start: "?target=", 69 | }, 70 | ], 71 | }, 72 | { 73 | //https://link.juejin.cn/?target=https://baidu.com 74 | name: "掘金", 75 | url: "link.juejin.cn/?target=", 76 | handlers: [ 77 | { 78 | type: "forward", 79 | start: "?target=", 80 | }, 81 | ], 82 | }, 83 | { 84 | //https://www.jianshu.com/go-wild?ac=2&url=https://baidu.com 85 | name: "简书", 86 | url: "www.jianshu.com/go-wild?", 87 | handlers: [ 88 | { 89 | type: "forward", 90 | start: "&url=", 91 | }, 92 | ], 93 | }, 94 | { 95 | //https://www.oschina.net/action/GoToLink?url=https://baidu.com 96 | name: "开源中国", 97 | url: "www.oschina.net/action/GoToLink?url=", 98 | handlers: [ 99 | { 100 | type: "forward", 101 | start: "GoToLink?url=", 102 | }, 103 | ], 104 | }, 105 | { 106 | //https://gitee.com/link?target=https://baidu.com 107 | name: "码云", 108 | url: "gitee.com/link?target=", 109 | handlers: [ 110 | { 111 | type: "forward", 112 | start: "?target=", 113 | }, 114 | ], 115 | }, 116 | { 117 | //https://leetcode.cn/link/?target=https://www.baidu.com 118 | name: "扣丁", 119 | url: "leetcode.cn", 120 | handlers: [ 121 | { 122 | type: "forward", 123 | start: "link/?target=", 124 | }, 125 | ], 126 | }, 127 | { 128 | //https://blog.51cto.com/u_15127617/4063137 129 | //https://blog.51cto.com/transfer?https://baidu.com 130 | name: "51CTO", 131 | url: "blog.51cto.com/transfer?", 132 | handlers: [ 133 | { 134 | type: "forward", 135 | start: "transfer?", 136 | }, 137 | ], 138 | }, 139 | { 140 | //https://www.coolapk.com/link?url=https%3A%2F%2Flanzoux.com 141 | name: "酷安", 142 | url: "www.coolapk.com/link?url=", 143 | handlers: [ 144 | { 145 | type: "forward", 146 | start: "link?url=", 147 | }, 148 | ], 149 | }, 150 | { 151 | //https://mail.qq.com/cgi-bin/readtemplate?t=safety&check=false&gourl=https://www.baidu.com 152 | name: "酷安", 153 | url: "mail.qq.com/cgi-bin/readtemplate?", 154 | handlers: [ 155 | { 156 | type: "forward", 157 | start: "gourl=", 158 | }, 159 | ], 160 | }, 161 | ]; 162 | 163 | /** 164 | * 去除页面重定向列表 165 | * @type {重定向网站} 166 | */ 167 | const websites = [ 168 | { 169 | //https://www.zhihu.com/question/465346075/answer/2048804228 170 | //https://zhuanlan.zhihu.com/p/95937067 171 | name: "知乎", 172 | url: "zhihu.com", 173 | handlers: [ 174 | { 175 | selector: ".external,.LinkCard", 176 | start: "?target=", 177 | type: "sub", 178 | }, 179 | ], 180 | }, 181 | { 182 | //https://juejin.cn/post/6844903688524267534 183 | name: "掘金", 184 | url: "juejin.cn", 185 | handlers: [ 186 | { 187 | selector: "a[href]", 188 | start: "?target=", 189 | type: "sub", 190 | }, 191 | ], 192 | }, 193 | { 194 | //https://www.jianshu.com/p/cf7dc734dd6d 195 | name: "简书", 196 | url: "www.jianshu.com/p/", 197 | handlers: [ 198 | { 199 | selector: "a[href]", 200 | start: "go?to=", 201 | type: "sub", 202 | }, 203 | ], 204 | }, 205 | { 206 | //https://tieba.baidu.com/p/6313991324 207 | name: "百度贴吧", 208 | url: "tieba.baidu.com/p/", 209 | handlers: [ 210 | //PC版 211 | { 212 | selector: ".j-no-opener-url", 213 | start: "jump.bdimg.com", 214 | type: "text", 215 | }, 216 | { 217 | selector: ".j-no-opener-url", 218 | start: "jump2.bdimg.com", 219 | type: "text", 220 | }, 221 | //手机版 222 | { 223 | selector: ".rich-link", 224 | start: "checkurl?url=", 225 | end: "&urlrefer=", 226 | type: "sub", 227 | }, 228 | ], 229 | }, 230 | { 231 | //https://my.oschina.net/lorryluMyRest/blog/731722 232 | name: "开源中国", 233 | url: "oschina.net", 234 | handlers: [ 235 | { 236 | selector: "a[href]", 237 | start: "GoToLink?url=", 238 | type: "sub", 239 | }, 240 | ], 241 | }, 242 | { 243 | //https://gitee.com/iflytek/iflearner 244 | name: "gitee", 245 | url: "gitee.com", 246 | handlers: [ 247 | { 248 | selector: "a[href]", 249 | start: "link?target=", 250 | type: "sub", 251 | }, 252 | ], 253 | }, 254 | { 255 | //https://www.so.com/s?ie=UTF-8&q=123 256 | name: "360搜索PC版", 257 | url: "www.so.com/s", 258 | handlers: [ 259 | { 260 | selector: "a[data-mdurl]", 261 | start: "link?m=", 262 | attribute: "data-mdurl", 263 | type: "attribute", 264 | }, 265 | ], 266 | }, 267 | { 268 | //https://m.so.com/s?q=%E4%BD%A0%E5%A5%BD 269 | name: "360搜索手机版", 270 | url: "m.so.com", 271 | handlers: [ 272 | { 273 | selector: "a[href]", 274 | start: "jump?u=", 275 | end: "&m=", 276 | type: "sub", 277 | }, 278 | ], 279 | }, 280 | { 281 | //https://www.423down.com/10579.html 282 | name: "423down", 283 | url: "www.423down.com", 284 | handlers: [ 285 | { 286 | selector: "p>a[href]", 287 | start: "/go.php?url=", 288 | type: "text", 289 | }, 290 | ], 291 | }, 292 | ]; 293 | 294 | /** 295 | * 百度单独规则 296 | */ 297 | if (location.href.includes("m.baidu.com") || location.href.includes("www.baidu.com")) { 298 | let interval = setInterval(() => { 299 | let flag = baidu_static(); 300 | }, 100); 301 | } 302 | /** 303 | * 百度静态规则 304 | */ 305 | function baidu_static() { 306 | //pc端 307 | let item1s = document.querySelectorAll("#content_left>div"); 308 | for (let item of item1s) { 309 | let a = item.querySelector("a"); 310 | if (a && a.href.includes("www.baidu.com/link?url=")) { 311 | let url = item.getAttribute("mu"); 312 | //https://www.baidu.com/s?wd=一夜醒来欠地铁600多万?官方回应 313 | //智能精选 314 | if (url && url != "null" && !url.includes("nourl.ubs.baidu.com") && !url.includes("nourl.baidu.com")) { 315 | a.href = url; 316 | console.log(url); 317 | } 318 | } 319 | //single-card-wrapper: https://www.baidu.com/s?ie=UTF-8&wd=es6 xxx的最新相关信息 320 | //group-wrapper: https://www.baidu.com/s?ie=UTF-8&wd=五一消费成绩单折射市场活力 资讯 321 | let item_news = item.querySelectorAll("[class^=single-card-wrapper] div,[class^=group-wrapper] div"); 322 | for (let item_new of item_news) { 323 | let data_url; 324 | let divs = item_new.querySelectorAll("div"); 325 | for (let div of divs) { 326 | if ((data_url = div.getAttribute("data-url"))) { 327 | let a = item_new.querySelector("a"); 328 | a.setAttribute("href", data_url); 329 | } 330 | } 331 | } 332 | } 333 | 334 | //移动端 335 | let item2s = document.querySelectorAll("#results>div"); 336 | for (let item of item2s) { 337 | let rl_link_href = item.querySelector("[rl-link-href]"); 338 | if (rl_link_href && rl_link_href != null) { 339 | let str = item.getAttribute("data-log"); 340 | let json = JSON.parse(str); 341 | let url = json.mu; 342 | if (!url.startsWith("https://ks.baidu.com") && url) { 343 | //ks.baidu.com https://www.baidu.com/s?word=赵匡胤 344 | rl_link_href.setAttribute("rl-link-href", url); 345 | let as = item.querySelectorAll("a"); 346 | for (let a of as) { 347 | a.href = url; 348 | } 349 | } 350 | } 351 | } 352 | return false; 353 | } 354 | 355 | /** 356 | * 必应单独规则 357 | * https://www.bing.com/search?q=必应 358 | */ 359 | if (location.href.includes("bing.com/search")) { 360 | function handlerAnchor(a) { 361 | let url_ = a.href; 362 | if (url_.includes(".bing.com/ck/a?")) { 363 | // 截取 u= 及其后面的字符 364 | let tmp = url_.slice(url_.lastIndexOf("u=")); 365 | // 找到 u= 后的第一个 `&`, 精确提取出 u 366 | tmp = tmp.slice("u=a1".length, tmp.indexOf("&")); 367 | const paddingNeeded = 4 - tmp.length % 4; 368 | // 如果长度不是4的倍数,则需要补充'=' 369 | if (paddingNeeded != 4) { 370 | tmp += '='.repeat(paddingNeeded); 371 | } 372 | try { 373 | let ori_url = atob(tmp.replace('-', '+').replace('_', '/')); 374 | a.href = ori_url; 375 | } catch (e) { 376 | console.log("Error parsing", tmp); 377 | } 378 | } 379 | } 380 | 381 | function afterLoaded(f_) { 382 | if (document.readyState === 'loading') { 383 | document.addEventListener('DOMContentLoaded', f_); 384 | } else { 385 | typeof f_ === 'function' && f_(); 386 | } 387 | } 388 | 389 | afterLoaded(() => { 390 | console.log("Started"); 391 | document.querySelectorAll('a').forEach(handlerAnchor); 392 | // 使用 MutationObserver 监控 DOM 变化 393 | const observer = new MutationObserver((mutationsList) => { 394 | for (const mutation of mutationsList) { 395 | if (mutation.type === 'childList') { 396 | mutation.addedNodes.forEach(node => { 397 | if (node.nodeType === Node.ELEMENT_NODE) { 398 | node.querySelectorAll('a').forEach(handlerAnchor); 399 | } 400 | }); 401 | } 402 | } 403 | }); 404 | 405 | // 观察整个文档的 DOM 变化 406 | observer.observe(document.body, { 407 | childList: true, 408 | subtree: true 409 | }); 410 | }); 411 | } 412 | 413 | /** 414 | * 安全页面跳转:处理 415 | */ 416 | for (let safePage of safePages) { 417 | if (location.href.includes(safePage.url)) { 418 | for (let handler of safePage.handlers) { 419 | let str = location.href.split(handler.start)[1]; 420 | console.log(str); 421 | let url = decodeURIComponent(str); 422 | console.log(url); 423 | location.replace(url); 424 | } 425 | } 426 | } 427 | 428 | /** 429 | * 页面重定向跳转:处理 430 | */ 431 | for (let website of websites) { 432 | if (location.href.includes(website.url)) { 433 | let time = 0; 434 | let interval = setInterval(() => { 435 | if (++time == 100) { 436 | clearInterval(interval); 437 | } 438 | for (let handler of website.handlers) { 439 | let items = document.querySelectorAll(handler.selector); 440 | for (let item of items) { 441 | //进一步校验需要修改的元素,防止修改错元素 442 | if (item.getAttribute("href").includes(handler.start)) { 443 | if (handler.type == "sub") { 444 | //从属性中截取地址 445 | let href = item.getAttribute("href"); 446 | let start_index = href.indexOf(handler.start) + handler.start.length; 447 | let str; 448 | if (handler.end != null) { 449 | let end_index = href.indexOf(handler.end); 450 | str = href.substring(start_index, end_index); 451 | } else { 452 | str = href.substring(start_index); 453 | } 454 | let url = decodeURIComponent(str); 455 | item.setAttribute("href", url); 456 | } else if (handler.type == "attribute") { 457 | //从属性中获取地址 458 | item.setAttribute("href", item.getAttribute(handler.attribute)); 459 | } else { 460 | //从文本中获取地址 461 | item.setAttribute("href", item.innerText); 462 | } 463 | } 464 | } 465 | } 466 | }, 100); 467 | } 468 | } 469 | 470 | /** 471 | * 跳转中文文档规则 472 | */ 473 | const otherSites = [ 474 | { 475 | //https://eslint.org/docs/latest/user-guide/configuring/configuration-files 476 | //https://zh-hans.eslint.org/docs/latest/user-guide/configuring/configuration-files 477 | name: "eslint", 478 | url: "https://eslint.org/docs/latest/", 479 | type: "host", 480 | zh_str: "zh-hans", 481 | }, 482 | { 483 | //https://learn.microsoft.com/zh-cn/powershell/scripting/how-to-use-docs 484 | name: "microsoft", 485 | url: "https://learn.microsoft.com/", 486 | type: "pathName", 487 | zh_str: "zh-cn", 488 | }, 489 | { 490 | //https://developer.mozilla.org/zh-CN/ 491 | name: "MDN", 492 | url: "https://developer.mozilla.org/", 493 | type: "pathName", 494 | zh_str: "zh-CN", 495 | }, 496 | { 497 | //https://www.tampermonkey.net/faq.php?locale=zh 498 | name: "tampermonkey", 499 | url: "https://www.tampermonkey.net", 500 | type: "search", 501 | zh_str: "locale=zh", 502 | }, 503 | ]; 504 | 505 | /** 506 | * GM相关APi的操作 507 | */ 508 | if (GM_info) { 509 | const scriptHandler = GM_info.scriptHandler; 510 | /** 511 | * 仅在油侯插件上运行,避免无法点击注册开关 512 | */ 513 | if (scriptHandler == "Tampermonkey" || scriptHandler == "Violentmonkey" || scriptHandler == "ScriptCat" || scriptHandler == "Via") { 514 | /** 515 | * 自动跳转中文文档 516 | */ 517 | if (GM_getValue("forward_zh")) { 518 | GM_registerMenuCommand("[√]跳转中文文档", function () { 519 | GM_setValue("forward_zh", false); 520 | location.reload(); 521 | }); 522 | let web_url = location.href; 523 | for (let otherSite of otherSites) { 524 | if (web_url.startsWith(otherSite.url)) { 525 | let zh_index = location.href.search(otherSite.zh_str); 526 | // 当前页面不是中文文档 527 | if (zh_index == -1) { 528 | if (otherSite.type == "pathName") { 529 | let pathname = location.pathname; 530 | let str = pathname.split("/")[1]; 531 | if (str != otherSite.zh_str) { 532 | let new_url = web_url.replace(str, otherSite.zh_str); 533 | location.replace(new_url); 534 | } 535 | } else if (otherSite.type == "host") { 536 | let host = location.host; 537 | let str = host.split(".")[0]; 538 | if (str != otherSite.zh_str) { 539 | let new_host = otherSite.zh_str + "." + host; 540 | let new_url = web_url.replace(host, new_host); 541 | location.replace(new_url); 542 | } 543 | } else if (otherSite.type == "search") { 544 | let search = location.search; 545 | if (search) { 546 | //有参数 547 | let key = otherSite.zh_str.split("=")[0]; 548 | let start_index = search.search(key); 549 | let end_index = start_index + otherSite.zh_str.length; 550 | if (start_index != -1) { 551 | //有指定参数 552 | let str = search.substring(start_index, end_index); 553 | if (str != otherSite.zh_str) { 554 | //数值不对 555 | let url = web_url.replace(str, otherSite.zh_str); 556 | location.replace(url); 557 | } 558 | } else { 559 | //没有指定参数 560 | let url = web_url + "&" + otherSite.zh_str; 561 | location.replace(url); 562 | } 563 | } else { 564 | //没有参数 565 | let url = web_url + "?" + otherSite.zh_str; 566 | location.replace(url); 567 | } 568 | } 569 | } 570 | } 571 | } 572 | } else { 573 | GM_registerMenuCommand("[x]跳转中文文档", function () { 574 | GM_setValue("forward_zh", true); 575 | location.reload(); 576 | }); 577 | } 578 | } 579 | } 580 | })(); 581 | -------------------------------------------------------------------------------- /NetdiskAssistant.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 网盘助手 3 | // @version 0.0.1 4 | // @namespace airbash/Netdiskassistant 5 | // @homepageURL https://github.com/AirBashX/UserScript 6 | // @author airbash 7 | // @description 点击文件直接下载或跳转:蓝凑云、猫狸盘搜 8 | // @match *://*.lanzoub.com/* 9 | // @match *://*.lanzouc.com/* 10 | // @match *://*.lanzoue.com/* 11 | // @match *://*.lanzouf.com/* 12 | // @match *://*.lanzouh.com/* 13 | // @match *://*.lanzoui.com/* 14 | // @match *://*.lanzouj.com/* 15 | // @match *://*.lanzouk.com/* 16 | // @match *://*.lanzoul.com/* 17 | // @match *://*.lanzoum.com/* 18 | // @match *://*.lanzouo.com/* 19 | // @match *://*.lanzoup.com/* 20 | // @match *://*.lanzouq.com/* 21 | // @match *://*.lanzout.com/* 22 | // @match *://*.lanzouu.com/* 23 | // @match *://*.lanzouv.com/* 24 | // @match *://*.lanzouw.com/* 25 | // @match *://*.lanzoux.com/* 26 | // @match *://*.lanzouy.com/* 27 | // @match *://*.lanzob.com/* 28 | // @match *://*.lanzoe.com/* 29 | // @match *://*.lanzof.com/* 30 | // @match *://*.lanzoh.com/* 31 | // @match *://*.lanzoi.com/* 32 | // @match *://*.lanzoj.com/* 33 | // @match *://*.lanzol.com/* 34 | // @match *://*.lanzom.com/* 35 | // @match *://*.lanzoo.com/* 36 | // @match *://*.lanzop.com/* 37 | // @match *://*.lanzoq.com/* 38 | // @match *://*.lanzov.com/* 39 | // @match *://*.lanzow.com/* 40 | // @match *://*.lanzox.com/* 41 | // @match *://*.lanzoy.com/* 42 | // @match *://pan.lanzou.com/* 43 | // @match *://pc.woozooo.com/* 44 | // @match *://www.alipansou.com/* 45 | // @connect www.aliyundrive.com 46 | // @grant GM_openInTab 47 | // @grant GM_xmlhttpRequest 48 | // @grant window.close 49 | // @license GPL-3.0 50 | // @run-at document-start 51 | // ==/UserScript== 52 | 53 | (function () { 54 | "use strict"; 55 | const website_url = location.href; 56 | //猫狸网盘:文件页 57 | if (website_url.search("www.alipansou.com/search?") != -1) { 58 | onload = function () { 59 | let file_lists = document.querySelectorAll('.van-row a[href^="/s/"]'); 60 | for (let list of file_lists) { 61 | list.parentElement.addEventListener("click", function (e) { 62 | e.preventDefault(); // 阻止默认打开链接事件 63 | //自动打开网盘 64 | GM_xmlhttpRequest({ 65 | url: list.href.replace("/s/", "/cv/"), 66 | headers: { 67 | referer: list.href, 68 | }, 69 | onload: function (response) { 70 | GM_openInTab(response.finalUrl, { active: true }); 71 | }, 72 | }); 73 | }); 74 | } 75 | }; 76 | //猫狸网盘:跳转页 77 | } else if (website_url.search("www.alipansou.com/s/") != -1) { 78 | //关闭关注提示:可有可无 79 | document.cookie = "no_show_donate=1;max-age=100000000"; 80 | 81 | GM_xmlhttpRequest({ 82 | url: website_url.replace("/s/", "/cv/"), 83 | headers: { 84 | referer: website_url, 85 | }, 86 | onload: function (response) { 87 | GM_openInTab(response.finalUrl, { active: true }); 88 | window.close(); 89 | }, 90 | }); 91 | } else { 92 | let inter = setInterval(() => { 93 | //蓝凑云盘:列表页 94 | let file_lists = document.querySelectorAll("#infos a"); 95 | if (file_lists.length > 0) { 96 | for (let list of file_lists) { 97 | list.addEventListener("click", function (e) { 98 | e.preventDefault(); // 阻止默认打开链接事件 99 | GM_openInTab(list.href); // 后台打开 100 | }); 101 | } 102 | clearInterval(inter); 103 | } 104 | 105 | //蓝凑云盘:跳转页 106 | let download_file = document.querySelector("#tourl a"); 107 | if (download_file) { 108 | GM_openInTab(download_file.href); 109 | window.top.close(); 110 | } 111 | }, 1000); 112 | } 113 | })(); 114 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aibrashX/UserScript 2 | 3 | [![GitHub license](https://img.shields.io/github/license/airbashX/UserScript.svg?style=flat-square&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 4 | [![GitHub Star](https://img.shields.io/github/stars/airbashX/UserScript.svg?style=flat-square&label=Star&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 5 | [![GitHub Fork](https://img.shields.io/github/forks/airbashX/UserScript.svg?style=flat-square&label=Fork&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 6 | [![](https://data.jsdelivr.com/v1/package/gh/airbashX/UserScript/badge)](https://www.jsdelivr.com/package/gh/airbashX/UserScript) 7 | [![](https://img.shields.io/static/v1?label=%20&message=GreasyFork&style=flat-square&labelColor=7B0000&color=960000&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII=)](https://greasyfork.org/zh-CN/users/698573-厌学的骚年) 8 | 9 | 🔨 自用的油猴脚本,支持手机和PC双平台,**有什么需求、建议、问题直接提 [Issues](https://github.com/airbashX/UserScript/issues/new/choose)**也可以前往 GreasyFork 脚本页向我反馈,觉得**好用请点个 ⭐ 鼓励一下叭~** 10 | 11 | ## 脚本列表 12 | 13 | | 脚本 | 名称 | 功能 | 安装 | 14 | | :--------------------: | :----------- | :----------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | 15 | | AutoUnfold | **自动展开** | 自动展开文章或新闻等`隐藏`、`折叠`部分 | **[GreasyFork](https://greasyfork.org/zh-CN/scripts/438656)**
**[github](https://github.com/AirBashX/UserScript/raw/master/AutoUnfold.user.js)**
**[jsdelivr](https://cdn.jsdelivr.net/gh/AirBashX/UserScript@master/AutoUnfold.user.js)** | 16 | | AnnoyancesInterception | **骚扰拦截** | 自动拦截或删除`下载弹窗`、`悬浮按钮`等影响用户体验的骚扰元素 | **[GreasyFork](https://greasyfork.org/zh-CN/scripts/440871)**
**[github](https://github.com/AirBashX/UserScript/raw/master/AnnoyancesInterception.user.js)**
**[jsdelivr](https://cdn.jsdelivr.net/gh/AirBashX/UserScript@master/AnnoyancesInterception.user.js)** | 17 | | LinkManager | **链接管理** | 取消点击链接后跳转到安全页面 | **[GreasyFork](https://greasyfork.org/zh-CN/scripts/443670)**
**[github](https://github.com/AirBashX/UserScript/raw/master/LinkManager.user.js)**
**[jsdelivr](https://cdn.jsdelivr.net/gh/AirBashXt@master/UserScript/LinkManager.user.js)** | 18 | | DoubanAssistant | **豆瓣助手** | 恢复IMDB链接,快速搜索字幕资源 | **[GreasyFork](https://greasyfork.org/zh-CN/scripts/456585)**
**[github](https://github.com/AirBashX/UserScript/raw/master/DoubanAssistant.user.js)**
**[jsdelivr](https://cdn.jsdelivr.net/gh/AirBashXt@master/UserScript/DoubanAssistant.user.js)** | 19 | 20 | > _jsdelivr 安装途径会比其他途径晚 24 小时刷新_ 21 | 22 | --- 23 | 24 | 25 | ## License 26 | 27 | The GPL-3.0 License. 28 | 29 | 所有脚本仅供学习交流,请勿用于商用等其他用途。 30 | 31 | 脚本所有权归 AirBashX(厌学的骚年) 所有。 -------------------------------------------------------------------------------- /RemoveSuffix.md: -------------------------------------------------------------------------------- 1 | [![GitHub license](https://img.shields.io/github/license/airbashX/UserScript.svg?style=flat-square&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 2 | [![GitHub Star](https://img.shields.io/github/stars/airbashX/UserScript.svg?style=flat-square&label=Star&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 3 | [![GitHub Fork](https://img.shields.io/github/forks/airbashX/UserScript.svg?style=flat-square&label=Fork&color=4285dd&logo=github)](https://github.com/airbashX/UserScript/) 4 | [![](https://data.jsdelivr.com/v1/package/gh/airbashX/UserScript/badge)](https://www.jsdelivr.com/package/gh/airbashX/UserScript) 5 | [![](https://img.shields.io/static/v1?label=%20&message=GreasyFork&style=flat-square&labelColor=7B0000&color=960000&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3ggEBCQHM3fXsAAAAVdJREFUOMudkz2qwkAUhc/goBaGJBgUtBCZyj0ILkpwAW7Bws4yO3AHLiCtEFD8KVREkoiFxZzX5A2KGfN4F04zMN+ce+5c4LMUgDmANYBnrnV+plBSi+FwyHq9TgA2LQpvCiEiABwMBtzv95RSfoNEHy8DYBzHrNVqVEr9BWKcqNFoxF6vx3a7zc1mYyC73a4MogBg7vs+z+czO50OW60Wt9stK5UKp9Mpj8cjq9WqDTBHnjAdxzGQZrPJw+HA31oulzbAWgLoA0CWZVBKIY5jzGYzdLtdE9DlcrFNrY98zobqOA6TJKHW2jg4nU5sNBpFDp6mhVe5rsvVasUwDHm9Xqm15u12o+/7Hy0gD8KatOd5vN/v1FozTVN6nkchxFuI6hsAAIMg4OPxMJCXdtTbR7JJCMEgCJhlGUlyPB4XfumozInrupxMJpRSRtZlKoNYl+m/6/wDuWAjtPfsQuwAAAAASUVORK5CYII=)](https://greasyfork.org/zh-CN/users/698573-厌学的骚年) 6 | 7 | # 相关功能: 8 | 移除复制后缀 9 | 10 | # 相关脚本: 11 | | 名称 | 功能 | 12 | | :----------- | :----------------------------------------------------------- | 13 | | **[自动展开](https://greasyfork.org/zh-CN/scripts/438656)** | 自动展开文章或新闻等`隐藏`、`折叠`部分 | 14 | | **[骚扰拦截](https://greasyfork.org/zh-CN/scripts/440871)** | 自动拦截`下载弹窗`、`悬浮按钮`、`登录弹窗`等影响用户体验的骚扰元素 | 15 | | **[链接管理](https://greasyfork.org/zh-CN/scripts/443670)** | 取消点击链接后跳转到安全页面 | 16 | | **[移除复制后缀](https://greasyfork.org/zh-CN/scripts/472307)** | 移除复制后附带的`后缀`、`网站声明` | 17 | 18 | # 适配网站: 19 | |网站名|PC|Phone| 20 | |-|-|-| 21 | |CSDN|✔|✔| 22 | |掘金|✔|✔| 23 | |简书|✔|✔| 24 | |知乎专栏|✔|✔| 25 | |B站专栏|✔|✔| 26 | |力扣|✔|✔| 27 | 持续支持中... -------------------------------------------------------------------------------- /RemoveSuffix.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 移除复制后缀 3 | // @version 1.0.3 4 | // @namespace airbash/RemoveSuffix 5 | // @homepage https://github.com/AirBashX/UserScript 6 | // @author airbash 7 | // @description 移除复制后缀,手机、电脑全平台通用,长期维护:CSDN、简书、掘金、知乎专栏、B站专栏、力扣 8 | // @match *://*.csdn.net/* 9 | // @match *://*.juejin.cn/* 10 | // @match *://*.jianshu.com/* 11 | // @match *://www.zhihu.com/* 12 | // @match *://www.bilibili.com/read/* 13 | // @match *://leetcode.cn/* 14 | // @run-at document-start 15 | // @grant none 16 | // @license GPL-3.0 17 | // ==/UserScript== 18 | 19 | (function () { 20 | "use strict"; 21 | 22 | function copy() { 23 | document.addEventListener( 24 | "copy", 25 | function (event) { 26 | event.stopPropagation(); 27 | }, 28 | true 29 | ); 30 | } 31 | 32 | function userSelect() { 33 | let style = document.createElement("style"); 34 | style.append("*{user-select:auto !important}"); 35 | document.head.append(style); 36 | } 37 | 38 | copy(); 39 | userSelect(); 40 | })(); 41 | --------------------------------------------------------------------------------