From 831395f92054acada78b59820fb2b5cc97304750 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 30 Nov 2020 23:55:07 +0800 Subject: [PATCH 0001/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C=E5=88=97=E8=A1=A8=E9=A1=B5]?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 28 +++++++++++++++++++++------- Hostloc-Enhanced.user.js | 22 +++++++++++++++++----- Zhiyoo-Enhanced.user.js | 34 ++++++++++++++++++++++++---------- 3 files changed, 62 insertions(+), 22 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 4b6e8222b..bf3d57bec 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.1.6 +// @version 1.1.7 // @author X.I.U -// @description 自动签到、自动无缝翻页 +// @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* // @icon https://www.52pojie.cn/favicon.ico // @grant GM_xmlhttpRequest @@ -53,12 +53,12 @@ // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; - // 自动翻页规则 + // 自动翻页规则,scrollDelta 数值越大,滚动条触发点越高 let DBSite = { forum: { SiteTypeID: 1, pager: { - scrollDelta: 666 + scrollDelta: 766 } }, thread: { @@ -68,7 +68,7 @@ pageElement: 'css;div#postlist > div[id^="post_"]', HT_insert: ['css;div#postlist', 2], replaceE: '//div[@class="pg"] | //div[@class="pgbtn"]', - scrollDelta: 666 + scrollDelta: 766 } }, guide: { @@ -78,7 +78,7 @@ pageElement: 'css;div#threadlist div.bm_c table > tbody[id^="normalthread_"]', HT_insert: ['css;div#threadlist div.bm_c table', 2], replaceE: 'css;div.pg', - scrollDelta: 666 + scrollDelta: 766 } }, collection: { @@ -90,6 +90,16 @@ replaceE: 'css;div.pg', scrollDelta: 899 } + }, + search: { + SiteTypeID: 5, + pager: { + nextLink: '//a[@class="nxt"][@href]', + pageElement: 'css;div#threadlist > ul', + HT_insert: ['css;div#threadlist', 2], + replaceE: 'css;div.pg', + scrollDelta: 766 + } } }; @@ -98,7 +108,8 @@ FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 THREAD: DBSite.thread.SiteTypeID, // 帖子内 GUIDE: DBSite.guide.SiteTypeID, // 导读帖子列表 - COLLECTION: DBSite.collection.SiteTypeID // 淘贴列表 + COLLECTION: DBSite.collection.SiteTypeID, // 淘贴列表 + SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 }; // URL 匹配正则表达式 @@ -122,6 +133,9 @@ }else if (patt_collection.test(location.search)){ // 淘贴列表 curSite = DBSite.collection; + }else if(location.pathname === '/search.php'){ + // 搜索结果列表 + curSite = DBSite.search; } curSite.pageUrl = ""; // 下一页URL diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 3a8e1d8d8..a0adf095f 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.2 +// @version 1.0.3 // @author X.I.U // @description 自动无缝翻页 // @match *://www.hostloc.com/* @@ -75,6 +75,15 @@ HT_insert: ['css;div#threadlist div.bm_c table', 2], replaceE: 'css;div.pg', } + }, + search: { + SiteTypeID: 4, + pager: { + nextLink: '//a[@class="nxt"][@href]', + pageElement: 'css;div#threadlist > ul', + HT_insert: ['css;div#threadlist', 2], + replaceE: 'css;div.pg' + } } }; @@ -82,7 +91,8 @@ let SiteType = { FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 THREAD: DBSite.thread.SiteTypeID, // 帖子内 - GUIDE: DBSite.guide.SiteTypeID // 导读帖子列表 + GUIDE: DBSite.guide.SiteTypeID, // 导读帖子列表 + SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 }; // URL 匹配正则表达式 @@ -104,10 +114,12 @@ }else if (patt_guide.test(location.search)){ // 导读帖子列表 curSite = DBSite.guide; + }else if(location.pathname === '/search.php'){ + // 搜索结果列表 + curSite = DBSite.search; } - curSite.pageUrl = ""; // 下一页URL - + curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动翻页 @@ -117,7 +129,7 @@ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; - let scrollDelta = 666; + let scrollDelta = 766; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { if (curSite.SiteTypeID === SiteType.FORUM) { // 如果是各版块帖子列表则直接点下一页就行了 var autopbn = document.querySelector('#autopbn'); diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 4c30d7ee1..867a54f71 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -1,10 +1,11 @@ // ==UserScript== // @name 智友邦论坛增强 -// @version 1.1.2 +// @version 1.1.3 // @author X.I.U // @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、清理帖子标题〖XXX〗【XXX】文字 // @icon http://bbs.zhiyoo.net/favicon.ico // @match *://bbs.zhiyoo.net/* +// @match *://www.zhiyoo.net/search.php* // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand @@ -98,17 +99,30 @@ nextLink: '//a[@class="nxt"][@href]', pageElement: 'css;table#threadlisttableid > tbody[id^="normalthread_"]', HT_insert: ['css;table#threadlisttableid', 2], - replaceE: 'css;div.pg', + replaceE: 'css;div.pg' + } + }, + search: { + SiteTypeID: 2, + pager: { + nextLink: '//a[@class="nxt"][@href]', + pageElement: 'css;div#threadlist > ul', + HT_insert: ['css;div#threadlist', 2], + replaceE: 'css;div.pg' } } }; // 用于脚本内部判断当前 URL 类型 let SiteType = { - FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID // 各板块帖子列表 + FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID, // 各板块帖子列表 + SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 }; + curSite.pageUrl = ""; // 下一页URL + var patt_thread = /\/thread-\d+-\d+\-\d+.html/, // 匹配 /thread-XXX-X-X.html 帖子正则表达式 + patt_search = /\/thread-\d+-\d+\-\d+.html/, // 匹配搜索结果列表正则表达式 patt_posttitle = /^〖.+〗(:)?|^【.+】(:)?/; // 匹配帖子标题中的〖XXX〗【XXX】正则表达式 if (location.pathname === '/plugin.php'){ @@ -121,8 +135,7 @@ attachmentBack(); // 立即返回帖子 break; } - } - else if(location.pathname === '/forum.php'){ + }else if(location.pathname === '/forum.php'){ switch(getQueryVariable("mod")) { case 'viewthread': // 浏览帖子内容 @@ -130,15 +143,16 @@ autoReply(); // 自动回复(有隐藏内容才会回复),回复过就定位到底部(隐藏内容区域) break; case 'forumdisplay': // 浏览帖子列表 - curSite = DBSite.forumdisplay; - curSite.pageUrl = ""; // 下一页URL + curSite = DBSite.forumdisplay; // 帖子列表页 cleanTop(); // 清理置顶帖子 cleanPostTitle(); // 清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字 - pageLoading(); // 自动翻页 + pageLoading(); // 自动无缝翻页 break; } - } - else if (patt_thread.test(location.pathname)){ // 对于 /thread-XXX-X-X.html 这种帖子页面也和上面一样 + }else if(location.pathname === '/search.php'){ + curSite = DBSite.search; // 搜索结果列表页 + pageLoading(); // 自动无缝翻页 + }else if (patt_thread.test(location.pathname)){ // 对于 /thread-XXX-X-X.html 这种帖子页面也和上面一样 showHide(); autoReply(); } From fce775609f37a58403830863bed6eaf7ffe5a7a1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 1 Dec 2020 15:13:06 +0800 Subject: [PATCH 0002/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=B8=BB=E9=A1=B5=E6=96=87=E7=AB=A0=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E4=B8=8B=E6=B2=A1=E6=9C=89=E7=BD=AE=E9=A1=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 3e0b70b7d..a7b149843 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.1.5 +// @version 1.1.6 // @author X.I.U // @description 一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请 // @match *://www.zhihu.com/* @@ -217,7 +217,7 @@ function topTime_search() // 置顶显示时间 - 用户主页 function topTime_people() { - $(".ContentItem.AnswerItem").each(function(){ + $(".ContentItem.AnswerItem, .ContentItem.ArticleItem").each(function(){ if( !($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length>0 && $(this).find(".ContentItem-time").find("span").text() != null) { // 完整显示时间 From 8fed07e97cb69c0b2621d0a39d457fdfb42e9cbb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 2 Dec 2020 10:56:07 +0800 Subject: [PATCH 0003/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E7=AE=80?= =?UTF-8?q?=E5=8C=96=E5=85=91=E6=8D=A2=E9=99=84=E4=BB=B6/=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8B=E8=BD=BD]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 50 ++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 867a54f71..344d56360 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 智友邦论坛增强 -// @version 1.1.3 +// @version 1.1.4 // @author X.I.U -// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、清理帖子标题〖XXX〗【XXX】文字 +// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化兑换附件/附件下载、清理帖子标题〖XXX〗【XXX】文字 // @icon http://bbs.zhiyoo.net/favicon.ico // @match *://bbs.zhiyoo.net/* // @match *://www.zhiyoo.net/search.php* @@ -119,20 +119,25 @@ SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 }; + var attachmentHrefTime = 0; curSite.pageUrl = ""; // 下一页URL var patt_thread = /\/thread-\d+-\d+\-\d+.html/, // 匹配 /thread-XXX-X-X.html 帖子正则表达式 patt_search = /\/thread-\d+-\d+\-\d+.html/, // 匹配搜索结果列表正则表达式 - patt_posttitle = /^〖.+〗(:)?|^【.+】(:)?/; // 匹配帖子标题中的〖XXX〗【XXX】正则表达式 + patt_posttitle = /^〖.+〗(:)?|^【.+】(:)?/, // 匹配帖子标题中的〖XXX〗【XXX】正则表达式 + patt_attachment_href = /(?<=\\').+(?=\\')/ if (location.pathname === '/plugin.php'){ switch(getQueryVariable("id")) { - case 'dsu_paulsign:sign': // 被重定向到签到页面 - qiandao(); // 自动签到 + case 'dsu_paulsign:sign': // 被重定向到签到页面 + qiandao(); // 自动签到 break; - case 'piaobo_attachment': // 兑换附件后的提示页面 - attachmentBack(); // 立即返回帖子 + case 'piaobo_attachment': // 兑换附件后的提示页面 + attachmentBack(); // 立即返回帖子 + break; + case 'threed_attach:downld': // 附件下载页面 + goPan(); // 跳转至网盘页 break; } }else if(location.pathname === '/forum.php'){ @@ -141,17 +146,18 @@ case 'viewthread': // 浏览帖子内容 showHide(); // 先看看是否有隐藏内容,如果已显示则定位到隐藏内容区域,如果没有隐藏内容,则啥都不干 autoReply(); // 自动回复(有隐藏内容才会回复),回复过就定位到底部(隐藏内容区域) + var attachmentHref_Interval = setInterval(attachmentHref,100); // 兑换附件按钮改为直链(不再弹出确认提示框) break; case 'forumdisplay': // 浏览帖子列表 - curSite = DBSite.forumdisplay; // 帖子列表页 + curSite = DBSite.forumdisplay; // 帖子列表页(自动翻页) cleanTop(); // 清理置顶帖子 cleanPostTitle(); // 清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字 pageLoading(); // 自动无缝翻页 break; } }else if(location.pathname === '/search.php'){ - curSite = DBSite.search; // 搜索结果列表页 - pageLoading(); // 自动无缝翻页 + curSite = DBSite.search; // 搜索结果列表页(自动翻页) + pageLoading(); // 自动无缝翻页 }else if (patt_thread.test(location.pathname)){ // 对于 /thread-XXX-X-X.html 这种帖子页面也和上面一样 showHide(); autoReply(); @@ -254,6 +260,30 @@ } + // 附件下载页直接跳转至网盘 + function goPan() { + var gopan = document.querySelector('.threed_panbox .panframe .pan_left p a'); + if (gopan){ + location.href=gopan.href; + } + } + + + // 兑换附件按钮改为直链(不再弹出确认提示框) + function attachmentHref() { + attachmentHrefTime += 1; // 计算该函数执行次数 + var attachmenthref = document.querySelector('.tab_button .button a'); + if (attachmenthref && attachmenthref.href == "javascript:;"){ + var attachmenthref_href = attachmenthref.onclick.toString(); + attachmenthref.href = attachmenthref_href.match(patt_attachment_href)[0]; + attachmenthref.onclick = null; + } + if (attachmentHrefTime == 50 || document.getElementsByClassName("showhide").length > 0){ // 当该函数执行超过50次(5秒),或没有隐藏内容时停止定时执行 + clearInterval(attachmentHref_Interval) + } + } + + // 清理置顶帖子 function cleanTop(){ var showhide = document.querySelectorAll("a.showhide.y"); From 70c1cc3f47ab239b31e5029b2ba494048b74dbca Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 2 Dec 2020 13:29:13 +0800 Subject: [PATCH 0004/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E7=99=BB=E9=99=86=E5=BC=B9=E7=AA=97]=EF=BC=88?= =?UTF-8?q?=E5=85=8D=E7=99=BB=E5=BD=95=E7=9C=8B=E7=9F=A5=E4=B9=8E=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index a7b149843..401792c3a 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.1.6 +// @version 1.1.7 // @author X.I.U -// @description 一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请 +// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/static/favicon.ico @@ -312,6 +312,7 @@ function addTypeTips() { } } + // 监听 XMLHttpRequest 事件 function EventXMLHttpRequest() { var _send = window.XMLHttpRequest.prototype.send @@ -324,6 +325,16 @@ function EventXMLHttpRequest() { (function() { + // 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126 + let removeLoginModal = e => { + if (e.target.getElementsByClassName('Modal-wrapper').length > 0) { + e.target.getElementsByClassName('Modal-wrapper')[0].remove(); + setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); + } + } + document.addEventListener('DOMNodeInserted', removeLoginModal); + + // 默认折叠邀请 let timer=setInterval(function(){ if($(".QuestionInvitation-content").text().indexOf("更多推荐结果") > -1) From a7b76b6f4118d163ffc9108a59ba287ca18e2322 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 2 Dec 2020 14:16:34 +0800 Subject: [PATCH 0005/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=85?= =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E6=97=B6=E7=9B=91=E5=90=AC=E5=B9=B6?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=99=BB=E9=99=86=E5=BC=B9=E7=AA=97=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E7=99=BB=E5=BD=95][=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E7=9F=A5=E4=B9=8E]=20=E6=8C=89=E9=92=AE=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 401792c3a..f5c4ad9a8 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.1.7 +// @version 1.1.8 // @author X.I.U // @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请 // @match *://www.zhihu.com/* @@ -294,7 +294,7 @@ function addTypeTips() { patt_tip = /zhihu_e_tips/ var postList = document.querySelectorAll('h2.ContentItem-title a'); postNum = document.querySelectorAll('small.zhihu_e_tips'); - console.log(`${postList.length} ${postNum.length}`) + //console.log(`${postList.length} ${postNum.length}`) if (postList.length > postNum.length){ for(var num = postNum.length;num { + if (e.target.getElementsByClassName('Modal-wrapper').length > 0) { + e.target.getElementsByClassName('Modal-wrapper')[0].remove(); + setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); + } + } + document.addEventListener('DOMNodeInserted', removeLoginModal); +} + // 监听 XMLHttpRequest 事件 function EventXMLHttpRequest() { @@ -323,16 +334,12 @@ function EventXMLHttpRequest() { window.XMLHttpRequest.prototype.send = sendReplacement; } - (function() { - // 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126 - let removeLoginModal = e => { - if (e.target.getElementsByClassName('Modal-wrapper').length > 0) { - e.target.getElementsByClassName('Modal-wrapper')[0].remove(); - setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); - } + if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 + removeLogin(); + document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录]按钮跳转至登录页面 + document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎]按钮跳转至注册页面(实际上是同一个页面) } - document.addEventListener('DOMNodeInserted', removeLoginModal); // 默认折叠邀请 From a2f7ed94a2481595a0c07242599c098a63c60d5c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 2 Dec 2020 17:08:44 +0800 Subject: [PATCH 0006/2377] update --- README.md | 110 +++++++++++++++++++++++++++--------------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 50773c539..9e545b3f3 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,56 @@ -# XIU2/UserScript - -[![GitHub license](https://img.shields.io/github/license/XIU2/UserScript.svg?style=flat-square&color=4285dd)](https://github.com/XIU2/UserScript/blob/master/LICENSE) -[![GitHub Star](https://img.shields.io/github/stars/XIU2/UserScript.svg?style=flat-square&label=Star&color=4285dd)](https://github.com/XIU2/UserScript/stargazers) -[![GitHub Fork](https://img.shields.io/github/forks/XIU2/UserScript.svg?style=flat-square&label=Fork&color=4285dd)](https://github.com/XIU2/UserScript/network/members) - -🔨 自用的一些乱七八糟油猴脚本,**有什么需求、建议、问题直接提 [Issues](https://github.com/XIU2/UserScript/issues/new/choose)**,觉得**好用请点个⭐鼓励一下下~** - -> 如果你只有 GreasyFork 账号,也可以前往 GreasyFork 脚本页面向我反馈! - -## 脚本列表 - -> 详细的脚本介绍、使用说明、截图,请点击第三列的 **「安装」** 前往 GreasyFork 查看。 -> 备用安装由 **`jsDelivr CDN`** 提供,优点是速度快(国内CDN),缺点是有 24小时缓存。 - -| 脚本名称 | 脚本功能 | 安装 | 备用 | -| :---- | :---- | :----: | :----: | -| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **[「安装」](https://greasyfork.org/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 一键收起回答、置顶显示时间、区分问题文章... | **[「安装」](https://greasyfork.org/scripts/412205)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | -| **吾爱破解论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/412681)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/412680)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| **全球主机交流论坛 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/414005)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[「安装」](https://greasyfork.org/scripts/397666)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | - -> 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! -> 所有脚本均在 _**Chrome、Firefox(国际版)、Edge(新版) + Tampermonkey**_ 环境下测试通过! - -**** - -## 如何安装/使用脚本? - -要使用该脚本,需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e) / [Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/) / [Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** - -安装扩展后,点击上面第三列 **「安装」**,再点击 **\[安装脚本\]** 后扩展会弹出提示,点击 **\[安装\]** 即可。 - -> 其他基于 **Chromium** 内核的浏览器(如国内套皮浏览器)都可以使用 Chrome 的扩展。 - -> 请确保使用 **Tampermonkey** 扩展,其他的用户脚本管理器可能导致**无法正常使用**脚本。 - -> _**不会离线安装 .crx 扩展?[Chrome、Edge 重新开启隐藏的 [拖入安装 .crx 扩展] 功能!](https://zhuanlan.zhihu.com/p/276027099)**_ - -**** - -## 许可证 - -The GPL-3.0 License. - -所有脚本仅供学习交流,请勿用于商用等其他用途。 - +# XIU2/UserScript + +[![GitHub license](https://img.shields.io/github/license/XIU2/UserScript.svg?style=flat-square&color=4285dd)](https://github.com/XIU2/UserScript/blob/master/LICENSE) +[![GitHub Star](https://img.shields.io/github/stars/XIU2/UserScript.svg?style=flat-square&label=Star&color=4285dd)](https://github.com/XIU2/UserScript/stargazers) +[![GitHub Fork](https://img.shields.io/github/forks/XIU2/UserScript.svg?style=flat-square&label=Fork&color=4285dd)](https://github.com/XIU2/UserScript/network/members) + +🔨 自用的一些乱七八糟油猴脚本,**有什么需求、建议、问题直接提 [Issues](https://github.com/XIU2/UserScript/issues/new/choose)**,觉得**好用请点个⭐鼓励一下下~** + +> 如果你只有 GreasyFork 账号,也可以前往 GreasyFork 脚本页面向我反馈! + +## 脚本列表 + +> 详细的脚本介绍、使用说明、截图,请点击第三列的 **「安装」** 前往 GreasyFork 查看。 +> 备用安装由 **`jsDelivr CDN`** 提供,优点是速度快(国内CDN),缺点是有 24小时缓存。 + +| 脚本名称 | 脚本功能 | 安装 | 备用 | +| :---- | :---- | :----: | :----: | +| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **[「安装」](https://greasyfork.org/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **[「安装」](https://greasyfork.org/scripts/412205)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | +| **吾爱破解论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/412681)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/412680)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| **全球主机交流论坛 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/414005)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[「安装」](https://greasyfork.org/scripts/397666)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | + +> 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! +> 所有脚本均在 _**Chrome、Firefox(国际版)、Edge(新版) + Tampermonkey**_ 环境下测试通过! + +**** + +## 如何安装/使用脚本? + +要使用该脚本,需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e) / [Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/) / [Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** + +安装扩展后,点击上面第三列 **「安装」**,再点击 **\[安装脚本\]** 后扩展会弹出提示,点击 **\[安装\]** 即可。 + +> 其他基于 **Chromium** 内核的浏览器(如国内套皮浏览器)都可以使用 Chrome 的扩展。 + +> 请确保使用 **Tampermonkey** 扩展,其他的用户脚本管理器可能导致**无法正常使用**脚本。 + +> _**不会离线安装 .crx 扩展?[Chrome、Edge 重新开启隐藏的 [拖入安装 .crx 扩展] 功能!](https://zhuanlan.zhihu.com/p/276027099)**_ + +**** + +## 许可证 + +The GPL-3.0 License. + +所有脚本仅供学习交流,请勿用于商用等其他用途。 + 软件所有权归 X.I.U(XIU2) 所有。 \ No newline at end of file From d8b09a9274acfce71d7be21140bff8aaf7773074 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 8 Dec 2020 11:08:20 +0800 Subject: [PATCH 0007/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=AB=99=E5=A4=96=E7=9B=B4=E9=93=BE]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 69 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index f5c4ad9a8..aa8d6d62b 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.1.8 +// @version 1.1.9 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请 +// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链、默认折叠邀请 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/static/favicon.ico @@ -253,6 +253,68 @@ function topTime_people() }) } +// 默认站外直链,来自:https://greasyfork.org/scripts/402808 +function directLink () { + var equal, colon, external_href, protocol, path, new_href; + //文字链接 + $("a[class*=\'external\']").each(function () { + if ($(this).find("span").length > 0) { + new_href = $(this).text(); + $(this).attr("href", new_href); + } + else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { + external_href = $(this).attr("href"); + new_href = external_href.substring(external_href = $(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); + $(this).attr("href", decodeURIComponent(new_href)); + } + else { + external_href = $(this).attr("href"); + if (external_href.lastIndexOf("https%3A")) + new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("https%3A")); + else if (external_href.lastIndexOf("http%3A%2F%2F")) + new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("http%3A")); + $(this).attr("href", decodeURIComponent(new_href)); + } + }); + + //卡片链接 + $("a[class*=\'LinkCard\']:not([class*=\'MCNLinkCard\']):not([class*=\'ZVideoLinkCard\'])").each(function () { + if ($(this).find("LinkCard-title").length > 0 && $(this).find("LinkCard-title").indexOf("http") > -1) { + new_href = $(this).find("LinkCard-title").text(); + $(this).attr("href", new_href); + } + else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { + external_href = $(this).attr("href"); + new_href = external_href.substring(external_href = $(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); + $(this).attr("href", decodeURIComponent(new_href)); + } + else { + external_href = $(this).attr("href"); + if (external_href.lastIndexOf("https%3A")) + new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("https%3A")); + else if (external_href.lastIndexOf("http%3A%2F%2F")) + new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("http%3A")); + $(this).attr("href", decodeURIComponent(new_href)); + } + }); + + //旧版视频卡片链接 + $("a.VideoCard-link").each(function () { + if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { + external_href = $(this).attr("href"); + equal = external_href.lastIndexOf("http"); + colon = external_href.lastIndexOf("%3A"); + protocol = external_href.substring(equal, colon); + path = external_href.substring(colon + 5, external_href.length); + new_href = protocol + "://" + path; + $(this).attr("href", decodeURIComponent(new_href)); + } + }); + + //隐藏首页广告卡片 + $(".TopstoryItem--advertCard").hide(); +} + // 默认高清原图 function originalPic(){ $("img").each(function(){ @@ -368,7 +430,8 @@ function EventXMLHttpRequest() { } }) - setInterval(originalPic,100) + setInterval(originalPic,100); // 默认高清原图 + setInterval(directLink, 100); // 默认站外直链 //每个页面对应的功能函数 if(window.location.href.indexOf("question") > -1){ // 回答页 // From 1073d80bfc0b3beb1abe09a743af26f0447da359 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 8 Dec 2020 11:09:20 +0800 Subject: [PATCH 0008/2377] update --- 3dm-Beautification.user.js | 2 +- 52pojie-Beautification.user.js | 2 +- Zhihu-Beautification.user.js | 2 +- Zhiyoo-Beautification.user.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3dm-Beautification.user.js b/3dm-Beautification.user.js index e121c7d5b..59d0b84ce 100644 --- a/3dm-Beautification.user.js +++ b/3dm-Beautification.user.js @@ -2,7 +2,7 @@ // @name 3DM论坛美化 // @version 1.0.0 // @author X.I.U -// @description 精简多余内容 +// @description 精简多余内容 // @icon https://bbs.3dmgame.com/favicon.ico // @match *://bbs.3dmgame.com/* // @license GPL-3.0 License diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index 150e34d97..b93ceb36f 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -2,7 +2,7 @@ // @name 吾爱破解论坛美化 // @version 1.0.3 // @author X.I.U -// @description 精简多余内容 +// @description 精简多余内容 // @match *://www.52pojie.cn/* // @icon https://www.52pojie.cn/favicon.ico // @grant GM_registerMenuCommand diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index dedfa5f55..6d38a9635 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -2,7 +2,7 @@ // @name 知乎美化 // @version 1.0.5 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致 +// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/static/favicon.ico diff --git a/Zhiyoo-Beautification.user.js b/Zhiyoo-Beautification.user.js index 9077b5210..472a86a3d 100644 --- a/Zhiyoo-Beautification.user.js +++ b/Zhiyoo-Beautification.user.js @@ -2,7 +2,7 @@ // @name 智友邦论坛美化 // @version 1.0.1 // @author X.I.U -// @description 精简多余内容、宽屏显示 +// @description 精简多余内容、宽屏显示 // @icon http://bbs.zhiyoo.net/favicon.ico // @match *://bbs.zhiyoo.net/* // @license GPL-3.0 License From 4f5cd2807b8e413f84f96763960136a131284c1c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 8 Dec 2020 15:52:43 +0800 Subject: [PATCH 0009/2377] update --- 3dm-Enhanced.user.js | 2 +- GithubEnhanced-High-Speed-Download.user.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 86d5af8e3..65fffd4e0 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 3DM论坛增强 // @version 1.0.5 // @author X.I.U -// @description 自动回复、自动无缝翻页、清理置顶帖子 +// @description 自动回复、自动无缝翻页、清理置顶帖子 // @match *://bbs.3dmgame.com/* // @icon https://bbs.3dmgame.com/favicon.ico // @grant GM_xmlhttpRequest diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index eda522174..e3d5a1942 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -2,7 +2,7 @@ // @name Github 增强 - 高速下载 // @version 1.2.6 // @author X.I.U -// @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) +// @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @icon https://github.githubassets.com/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js From d315516e373ab16c852b05a4a11ed66495341302 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 9 Dec 2020 20:34:18 +0800 Subject: [PATCH 0010/2377] update --- Zhiyoo-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 344d56360..8b47a42d6 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 智友邦论坛增强 // @version 1.1.4 // @author X.I.U -// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化兑换附件/附件下载、清理帖子标题〖XXX〗【XXX】文字 +// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件兑换/下载、清理帖子标题〖XXX〗【XXX】文字 // @icon http://bbs.zhiyoo.net/favicon.ico // @match *://bbs.zhiyoo.net/* // @match *://www.zhiyoo.net/search.php* From 28c791a0b9a4c65ba4c0a3670dd994ad76b0e5bd Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 14 Dec 2020 10:46:00 +0800 Subject: [PATCH 0011/2377] update --- SteamWorkshopImageRepair.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SteamWorkshopImageRepair.user.js b/SteamWorkshopImageRepair.user.js index db0479335..24124f62e 100644 --- a/SteamWorkshopImageRepair.user.js +++ b/SteamWorkshopImageRepair.user.js @@ -4,7 +4,7 @@ // @version 1.0.0 // @author X.I.U // @description Fixed Steam Workshop image not showing -// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题 +// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题 // @match *://steamcommunity.com/sharedfiles/filedetails/* // @match *://steamcommunity.com/workshop/filedetails/* // @icon https://store.steampowered.com/favicon.ico From 4c6696eb96daf62c457ca23d9b0d7bdb348b8618 Mon Sep 17 00:00:00 2001 From: XIU2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 14 Dec 2020 10:49:38 +0800 Subject: [PATCH 0012/2377] update --- SteamWorkshopImageRepair.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SteamWorkshopImageRepair.user.js b/SteamWorkshopImageRepair.user.js index 24124f62e..7acb5b900 100644 --- a/SteamWorkshopImageRepair.user.js +++ b/SteamWorkshopImageRepair.user.js @@ -4,7 +4,7 @@ // @version 1.0.0 // @author X.I.U // @description Fixed Steam Workshop image not showing -// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题 +// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题 // @match *://steamcommunity.com/sharedfiles/filedetails/* // @match *://steamcommunity.com/workshop/filedetails/* // @icon https://store.steampowered.com/favicon.ico @@ -15,4 +15,4 @@ if(typeof onYouTubeIframeAPIReady == 'function') { onYouTubeIframeAPIReady(); -} \ No newline at end of file +} From c4f4beb32b009021931ad626d7f4cf390a69d9ad Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 15 Dec 2020 20:16:12 +0800 Subject: [PATCH 0013/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E8=AF=AF=E4=BC=A4=E8=AF=84=E8=AE=BA=E5=8C=BA=20[?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=9B=9E=E5=A4=8D]=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index aa8d6d62b..b9307a77b 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.1.9 +// @version 1.2.0 // @author X.I.U // @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链、默认折叠邀请 // @match *://www.zhihu.com/* @@ -378,7 +378,9 @@ function addTypeTips() { function removeLogin() { let removeLoginModal = e => { if (e.target.getElementsByClassName('Modal-wrapper').length > 0) { - e.target.getElementsByClassName('Modal-wrapper')[0].remove(); + if (e.target.getElementsByClassName('Modal-wrapper')[0].querySelector('.signFlowModal')){ + e.target.getElementsByClassName('Modal-wrapper')[0].remove(); + } setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); } } From d7b6a5d3737e4bf4b22b04c13df52535cbeb312e Mon Sep 17 00:00:00 2001 From: shangfabao <6221202+shangfabao@users.noreply.github.com> Date: Wed, 16 Dec 2020 12:09:43 +0800 Subject: [PATCH 0014/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=8C=89=E9=92=AE=E9=80=82=E9=85=8D=20Github=20?= =?UTF-8?q?=E9=BB=91=E8=89=B2=E6=A8=A1=E5=BC=8F=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * github dark mode * 黑色模式下修改a标签链接颜色 Co-authored-by: shangfabao --- GithubEnhanced-High-Speed-Download.user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index e3d5a1942..19e0ae9c2 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -18,6 +18,12 @@ // ==/UserScript== (function() { + var backColor='#ffffff'; + var fontColor='#888888'; + if('dark'==$('html').attr('data-color-mode')){ + backColor='#0D1117'; + fontColor='#58A6FF'; + } var download_url = [ ['https://gh.con.sh','美国'], ['https://gh.api.99988866.xyz','美国'], @@ -42,7 +48,7 @@ '', '' ], - style = ['padding:0 6px;margin-right: -1px;border-radius: 2px;background-color: #ffffff;border-color: rgba(27, 31, 35, 0.1);font-size: 11px;color: #888888;'], + style = ['padding:0 6px;margin-right: -1px;border-radius: 2px;background-color: '+backColor+';border-color: rgba(27, 31, 35, 0.1);font-size: 11px;color: '+fontColor+';'], menu_raw_fast = GM_getValue('xiu2_menu_raw_fast'), menu_menu_raw_fast_ID, menu_feedBack_ID; From 36c23c349db5cdab09339a245c90d646c39f5bda Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 16 Dec 2020 12:10:47 +0800 Subject: [PATCH 0015/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=8C=89=E9=92=AE=E9=80=82=E9=85=8D=20Github=20?= =?UTF-8?q?=E9=BB=91=E8=89=B2=E6=A8=A1=E5=BC=8F=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 19e0ae9c2..da74c2a8c 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ - // ==UserScript== +// ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.2.6 +// @version 1.2.7 // @author X.I.U // @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* From 5ba54db89b3a68dc54578a0cd687740d63ba4463 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Dec 2020 01:17:33 +0800 Subject: [PATCH 0016/2377] update --- Zhihu-Enhanced.user.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index b9307a77b..0c43e3dd4 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -67,7 +67,7 @@ function menu_switch(menu_status, Name, Tips) { registerMenuCommand(); // 重新注册脚本菜单 }; -// 置顶显示时间 - 首页 +// 置顶显示时间 - 首页,来自:https://greasyfork.org/scripts/402808 function topTime_index() { $(".TopstoryItem").each(function(){ @@ -107,7 +107,7 @@ function topTime_index() }) } -// 置顶显示时间 - 回答页 +// 置顶显示时间 - 回答页,来自:https://greasyfork.org/scripts/402808 function topTime_question() { //回答的发布时间 @@ -149,7 +149,7 @@ function topTime_question() $(".Pc-card.Card").attr("style","display:none") } -// 置顶显示时间 - 专栏/文章 +// 置顶显示时间 - 专栏/文章,来自:https://greasyfork.org/scripts/402808 function topTime_zhuanlan() { //隐藏推荐文章 @@ -175,7 +175,7 @@ function topTime_zhuanlan() } } -// 置顶显示时间 - 搜索结果页 +// 置顶显示时间 - 搜索结果页,来自:https://greasyfork.org/scripts/402808 function topTime_search() { $(".ContentItem.AnswerItem, .ContentItem.ArticleItem").each(function(){ @@ -214,7 +214,7 @@ function topTime_search() }) } -// 置顶显示时间 - 用户主页 +// 置顶显示时间 - 用户主页,来自:https://greasyfork.org/scripts/402808 function topTime_people() { $(".ContentItem.AnswerItem, .ContentItem.ArticleItem").each(function(){ @@ -315,7 +315,7 @@ function directLink () { $(".TopstoryItem--advertCard").hide(); } -// 默认高清原图 +// 默认高清原图,来自:https://greasyfork.org/scripts/402808 function originalPic(){ $("img").each(function(){ if($(this).attr("data-original")!=undefined && !$(this).hasClass("comment_sticker")) @@ -392,12 +392,22 @@ function removeLogin() { function EventXMLHttpRequest() { var _send = window.XMLHttpRequest.prototype.send function sendReplacement(data) { + console.log(`111111`); addTypeTips(); return _send.apply(this, arguments); } window.XMLHttpRequest.prototype.send = sendReplacement; } +(function (open) { + XMLHttpRequest.prototype.open = function () { + this.addEventListener("readystatechange", function () { + console.log(this.responseURL); + }, false); + open.apply(this, arguments); + }; +})(XMLHttpRequest.prototype.open); + (function() { if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 removeLogin(); @@ -406,7 +416,7 @@ function EventXMLHttpRequest() { } - // 默认折叠邀请 + // 默认折叠邀请,来自:https://greasyfork.org/scripts/402808 let timer=setInterval(function(){ if($(".QuestionInvitation-content").text().indexOf("更多推荐结果") > -1) { From d3894dd791a3444d6741c8aa42d33f4c2a289d9a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Dec 2020 13:20:14 +0800 Subject: [PATCH 0017/2377] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e545b3f3..e796a3120 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[「安装」](https://greasyfork.org/scripts/397666)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! -> 所有脚本均在 _**Chrome、Firefox(国际版)、Edge(新版) + Tampermonkey**_ 环境下测试通过! +> 所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过! **** From 6f6ade6d2f9f492176cd803a3fb12cc822e2a0f5 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Dec 2020 18:25:48 +0800 Subject: [PATCH 0018/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=BE=8E?= =?UTF-8?q?=E5=9B=BD=E6=B4=9B=E6=9D=89=E7=9F=B6=20Raw=20=E9=AB=98=E9=80=9F?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=9C=B0=E5=9D=80=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B=E7=A6=81=E7=94=A8=20=E7=BE=8E?= =?UTF-8?q?=E5=9B=BD=E6=B4=9B=E6=9D=89=E7=9F=B6=EF=BC=88=E6=9A=82=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E7=9A=84=E4=BA=BA=E5=A4=AA=E5=A4=9A=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=20Github=20=E9=99=90=E5=88=B6=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index da74c2a8c..7a3267232 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.2.7 +// @version 1.2.8 // @author X.I.U -// @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) +// @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @icon https://github.githubassets.com/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js @@ -18,11 +18,11 @@ // ==/UserScript== (function() { - var backColor='#ffffff'; - var fontColor='#888888'; - if('dark'==$('html').attr('data-color-mode')){ - backColor='#0D1117'; - fontColor='#58A6FF'; + var backColor = '#ffffff'; + var fontColor = '#888888'; + if('dark' == $('html').attr('data-color-mode')){ // 黑暗模式判断 + backColor = '#0D1117'; + fontColor = '#58A6FF'; } var download_url = [ ['https://gh.con.sh','美国'], @@ -30,7 +30,7 @@ ['https://download.fastgit.org','日本东京'], ['https://pd.zwc365.com/seturl','中国香港'], ['https://g.ioiox.com','中国香港'], - ['https://git.yumenaka.net','美国洛杉矶'] + ['https://git.yumenaka1.net','美国洛杉矶[x]'] ], clone_url = [ 'https://hub.fastgit.org', @@ -41,7 +41,7 @@ ['https://raw.githubusercontent.com','Github 原生',''], ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。 '], ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '], - ['https://git.yumenaka.net','美国洛杉矶','注意:经过测试,该加速源存在文件格式限制,如果无法下载说明不支持该文件格式。 '] + ['https://git.yumenaka1.net','美国洛杉矶[x]','注意:经过测试,该加速源存在文件格式限制,如果无法下载说明不支持该文件格式。 '] ], svg = [ '', @@ -201,7 +201,7 @@ url = [ raw_url[1][0] + "/gh" + href.replace('/blob/','@'), raw_url[2][0] + href2, - download_url[5] + "/" + raw_url[0][0] + href2 + raw_url[3][0] + "/" + raw_url[0][0] + href2 ], html = ` ${raw_url[1][1]} From d1ca829bdd4b21677355d616bd3f0dd7bc45edd3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Dec 2020 18:34:00 +0800 Subject: [PATCH 0019/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=BE=8E?= =?UTF-8?q?=E5=9B=BD=E6=B4=9B=E6=9D=89=E7=9F=B6=20Raw=20=E9=AB=98=E9=80=9F?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=9C=B0=E5=9D=80=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B=E7=A6=81=E7=94=A8=20=E7=BE=8E?= =?UTF-8?q?=E5=9B=BD=E6=B4=9B=E6=9D=89=E7=9F=B6=EF=BC=88=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E5=9B=A0=E4=B8=BA=E7=94=A8=E7=9A=84=E4=BA=BA?= =?UTF-8?q?=E5=A4=AA=E5=A4=9A=E8=A7=A6=E5=8F=91=20Github=20=E9=99=90?= =?UTF-8?q?=E5=88=B6=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 7a3267232..cffe2248b 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -30,7 +30,7 @@ ['https://download.fastgit.org','日本东京'], ['https://pd.zwc365.com/seturl','中国香港'], ['https://g.ioiox.com','中国香港'], - ['https://git.yumenaka1.net','美国洛杉矶[x]'] + ['https://gh.con.sh','美国洛杉矶*'] ], clone_url = [ 'https://hub.fastgit.org', @@ -41,7 +41,7 @@ ['https://raw.githubusercontent.com','Github 原生',''], ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。 '], ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '], - ['https://git.yumenaka1.net','美国洛杉矶[x]','注意:经过测试,该加速源存在文件格式限制,如果无法下载说明不支持该文件格式。 '] + ['https://raw.githubusercontent.com','美国洛杉矶*','注意:经过测试,该加速源存在文件格式限制,如果无法下载说明不支持该文件格式。 '] ], svg = [ '', @@ -201,7 +201,7 @@ url = [ raw_url[1][0] + "/gh" + href.replace('/blob/','@'), raw_url[2][0] + href2, - raw_url[3][0] + "/" + raw_url[0][0] + href2 + raw_url[3][0] + href2 ], html = ` ${raw_url[1][1]} @@ -265,7 +265,7 @@ url_tip = raw_url[2][2]; break; case 3: - url = raw_url[3][0] + '/' + raw_url[0][0] + href2; + url = raw_url[3][0] + href2; url_name = raw_url[3][1]; url_tip = raw_url[3][2]; break; From dfd427b92d1d2b63bcc98b8fa86c8f23aa74fb55 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 23 Dec 2020 00:00:33 +0800 Subject: [PATCH 0020/2377] update --- GithubEnhanced-High-Speed-Download.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index cffe2248b..feeda955f 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -30,7 +30,7 @@ ['https://download.fastgit.org','日本东京'], ['https://pd.zwc365.com/seturl','中国香港'], ['https://g.ioiox.com','中国香港'], - ['https://gh.con.sh','美国洛杉矶*'] + ['https://gh.con.sh','美国洛杉矶'] ], clone_url = [ 'https://hub.fastgit.org', @@ -41,7 +41,7 @@ ['https://raw.githubusercontent.com','Github 原生',''], ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。 '], ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '], - ['https://raw.githubusercontent.com','美国洛杉矶*','注意:经过测试,该加速源存在文件格式限制,如果无法下载说明不支持该文件格式。 '] + ['https://raw.githubusercontent.com','美国洛杉矶','注意:经过测试,该加速源存在文件格式限制,如果无法下载说明不支持该文件格式。 '] ], svg = [ '', From 556b2237ede15dc0fce9b4df5c93741b7558b1ad Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 24 Dec 2020 07:04:45 +0800 Subject: [PATCH 0021/2377] update --- README.md | 2 +- Zhihu-Enhanced.user.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e796a3120..6b9b424ff 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ | 脚本名称 | 脚本功能 | 安装 | 备用 | | :---- | :---- | :----: | :----: | | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **[「安装」](https://greasyfork.org/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **[「安装」](https://greasyfork.org/scripts/412205)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **[「安装」](https://greasyfork.org/scripts/419081)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 0c43e3dd4..9658779d6 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 知乎增强 // @version 1.2.0 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链、默认折叠邀请 +// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/static/favicon.ico From 18a40e6b927a27e247fda4f48c2d82a7f1f7e495 Mon Sep 17 00:00:00 2001 From: Zain Date: Thu, 24 Dec 2020 13:38:49 +0800 Subject: [PATCH 0022/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=82=AC=E8=B5=8F=E5=B8=96]=EF=BC=88=E5=AF=BC?= =?UTF-8?q?=E8=AF=BB=20-=20=E6=9C=80=E6=96=B0=E5=8F=91=E8=A1=A8=EF=BC=89?= =?UTF-8?q?=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index bf3d57bec..940ea932a 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -23,6 +23,28 @@ if (menu_thread_pageLoading == null){menu_thread_pageLoading = false; GM_setValue('xiu2_menu_thread_pageLoading', menu_thread_pageLoading)}; registerMenuCommand(); + //屏蔽悬赏帖 + function delateReward(){ + // delateSwitch: 是否开启新帖区屏蔽悬赏帖,true或者false + var delateSwitch = true; + if(location.href === "https://www.52pojie.cn/forum.php?mod=guide&view=newthread" && delateSwitch){ + var table = document.querySelector("#threadlist > div.bm_c > table"); + var tbodys = table.getElementsByTagName('tbody'); + var arrs = [] + for (let i=0; i Date: Thu, 24 Dec 2020 13:40:54 +0800 Subject: [PATCH 0023/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=82=AC=E8=B5=8F=E5=B8=96](=E5=AF=BC=E8=AF=BB=20-=20?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8F=91=E8=A1=A8)=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 242 ++++++++++++++++++++------------------- 1 file changed, 127 insertions(+), 115 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 940ea932a..3fca8c29a 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.1.7 +// @version 1.1.8 // @author X.I.U // @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* @@ -18,45 +18,29 @@ // ==/UserScript== (function() { - var menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'); - var menu_thread_pageLoading_ID, menu_feedBack_ID; + var menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'), + menu_delateReward = GM_getValue('xiu2_menu_delateReward'); + var menu_feedBack_ID, menu_thread_pageLoading_ID, menu_delateReward_ID; if (menu_thread_pageLoading == null){menu_thread_pageLoading = false; GM_setValue('xiu2_menu_thread_pageLoading', menu_thread_pageLoading)}; + if (menu_delateReward == null){menu_delateReward = false; GM_setValue('xiu2_menu_delateReward', menu_delateReward)}; registerMenuCommand(); - //屏蔽悬赏帖 - function delateReward(){ - // delateSwitch: 是否开启新帖区屏蔽悬赏帖,true或者false - var delateSwitch = true; - if(location.href === "https://www.52pojie.cn/forum.php?mod=guide&view=newthread" && delateSwitch){ - var table = document.querySelector("#threadlist > div.bm_c > table"); - var tbodys = table.getElementsByTagName('tbody'); - var arrs = [] - for (let i=0; i 0){ windowScroll(function (direction, e) { + //console.log('1111111') if (direction === "down") { // 下滑才准备翻页 var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; let scrollDelta = curSite.pager.scrollDelta; @@ -204,11 +193,9 @@ // 签到后立即返回 function qianDaoBack() { - if(location.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){ - var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a'); - if (qiandaoback){ - setTimeout(function(){qiandaoback.click()}, 500); - } + var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a'); + if (qiandaoback){ + setTimeout(function(){qiandaoback.click()}, 500); } } @@ -229,6 +216,29 @@ } + //屏蔽悬赏贴(导读-最新发表) + function delateReward(){ + if(patt_guide_newthread.test(location.search) && menu_delateReward){ + var table = document.querySelector("#threadlist > div.bm_c > table"), + tbodys = table.getElementsByTagName('tbody'), + arrs = []; + for (let i=0; i= 0; c--) o[(a = s[c]).nodeName] && i.removeChild(a); - return t; - } - } else console.error("没有找到要转成DOM的字符串"); - }, - loadMorePage: function () { - if (curSite.pager) { - let curPageEle = getElementByXpath(curSite.pager.nextLink); - var url = this.getFullHref(curPageEle); - //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); - if(url === '') return; - if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 - curSite.pageUrl = url; - // 读取下一页的数据 - curSite.pager.startFilter && curSite.pager.startFilter(); - GM_xmlhttpRequest({ - url: url, - method: "GET", - timeout: 5000, - onload: function (response) { - try { - var newBody = ShowPager.createDocumentByString(response.responseText); - let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); - let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; - if (pageElems.length >= 0) { - let addTo = "beforeend"; - if (curSite.pager.HT_insert[1] == 1) addTo = "beforebegin"; - // 插入新页面元素 - pageElems.forEach(function (one) { - toElement.insertAdjacentElement(addTo, one); - }); - // 替换待替换元素 - try { - let oriE = getAllElements(curSite.pager.replaceE); - let repE = getAllElements(curSite.pager.replaceE, newBody, newBody); - if (oriE.length === repE.length) { - for (var i = 0; i < oriE.length; i++) { - oriE[i].outerHTML = repE[i].outerHTML; + // 自动无缝翻页,修改自 https://greasyfork.org/scripts/14178 + function showPager() { + ShowPager = { + getFullHref: function (e) { + if(e == null) return ''; + "string" != typeof e && (e = e.getAttribute("href")); + var t = this.getFullHref.a; + return t || (this.getFullHref.a = t = document.createElement("a")), t.href = e, t.href; + }, + createDocumentByString: function (e) { + if (e) { + if ("HTML" !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, "application/xhtml+xml"); + var t; + try { + t = (new DOMParser).parseFromString(e, "text/html"); + } catch (e) { + } + if (t) return t; + if (document.implementation.createHTMLDocument) t = document.implementation.createHTMLDocument("ADocument"); else try { + (t = document.cloneNode(!1)).appendChild(t.importNode(document.documentElement, !1)), + t.documentElement.appendChild(t.createElement("head")), t.documentElement.appendChild(t.createElement("body")); + } catch (e) { + } + if (t) { + var r = document.createRange(); + r.selectNodeContents(document.body); + var n = r.createContextualFragment(e); + t.body.appendChild(n); + for (var a, o = { + TITLE: !0, + META: !0, + LINK: !0, + STYLE: !0, + BASE: !0 + }, i = t.body, s = i.childNodes, c = s.length - 1; c >= 0; c--) o[(a = s[c]).nodeName] && i.removeChild(a); + return t; + } + } else console.error("没有找到要转成DOM的字符串"); + }, + loadMorePage: function () { + if (curSite.pager) { + let curPageEle = getElementByXpath(curSite.pager.nextLink); + var url = this.getFullHref(curPageEle); + //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + if(url === '') return; + if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 + curSite.pageUrl = url; + // 读取下一页的数据 + curSite.pager.startFilter && curSite.pager.startFilter(); + GM_xmlhttpRequest({ + url: url, + method: "GET", + timeout: 5000, + onload: function (response) { + try { + var newBody = ShowPager.createDocumentByString(response.responseText); + let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); + let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; + if (pageElems.length >= 0) { + let addTo = "beforeend"; + if (curSite.pager.HT_insert[1] == 1) addTo = "beforebegin"; + // 插入新页面元素 + pageElems.forEach(function (one) { + toElement.insertAdjacentElement(addTo, one); + }); + //删除悬赏贴 + delateReward(); + // 替换待替换元素 + try { + let oriE = getAllElements(curSite.pager.replaceE); + let repE = getAllElements(curSite.pager.replaceE, newBody, newBody); + if (oriE.length === repE.length) { + for (var i = 0; i < oriE.length; i++) { + oriE[i].outerHTML = repE[i].outerHTML; + } } + } catch (e) { + console.log(e); } - } catch (e) { - console.log(e); } - //屏蔽悬赏帖 - delateReward(); + } catch (e) { + console.log(e); } - } catch (e) { - console.log(e); } - } - }); - } - }, - }; + }); + } + }, + }; + } function getElementByXpath(e, t, r) { From 4a97281854784604805f01c11523ced74073d301 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 24 Dec 2020 19:38:44 +0800 Subject: [PATCH 0024/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E9=97=AE=E9=A2=98=E6=96=87=E7=AB=A0]=20=E4=B8=AD?= =?UTF-8?q?=E7=BB=86=E5=88=86=E6=8C=87=E5=90=91=E5=9B=9E=E7=AD=94=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=92=8C=E7=BA=AF=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E5=90=8E=E8=80=85=E6=A0=87=E7=AD=BE=E9=A2=9C=E8=89=B2=E6=9B=B4?= =?UTF-8?q?=E7=BA=A2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 9658779d6..54744f8e2 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.0 +// @version 1.2.1 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链 +// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链、默认折叠邀请 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/static/favicon.ico @@ -352,6 +352,7 @@ function addTypeTips() { // URL 匹配正则表达式 var patt_zhuanlan = /zhuanlan.zhihu.com/, patt_question = /question\/\d+/, + patt_question_answer = /answer\/\d+/, patt_video = /\/zvideo\//, patt_tip = /zhihu_e_tips/ var postList = document.querySelectorAll('h2.ContentItem-title a'); @@ -359,12 +360,16 @@ function addTypeTips() { //console.log(`${postList.length} ${postNum.length}`) if (postList.length > postNum.length){ for(var num = postNum.length;num文章 ` + postList[num].innerHTML - }else if (patt_question.test(postList[num].href)){ // 如果是问题 - postList[num].innerHTML = `问题 ` + postList[num].innerHTML - }else if (patt_video.test(postList[num].href)){ // 如果是视频 + }else if (patt_question.test(postList[num].href)){ // 如果是问题 + if (patt_question_answer.test(postList[num].href)){ // 如果是指向回答的问题(而非指向纯问题的链接) + postList[num].innerHTML = `问题 ` + postList[num].innerHTML + }else{ + postList[num].innerHTML = `问题 ` + postList[num].innerHTML + } + }else if (patt_video.test(postList[num].href)){ // 如果是视频 postList[num].innerHTML = `视频 ` + postList[num].innerHTML } //postNum += 1; From de5364648d3f1043157505c2d523c476c5c4ce06 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 26 Dec 2020 15:10:41 +0800 Subject: [PATCH 0025/2377] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=20=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84[=E7=BE=8E=E5=9B=BD=E6=B4=9B=E6=9D=89?= =?UTF-8?q?=E7=9F=B6]=E4=B8=BA[=E4=B8=AD=E5=9B=BD=E9=A6=99=E6=B8=AF]?= =?UTF-8?q?=EF=BC=88=E6=88=91=E8=87=AA=E5=BB=BA=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index feeda955f..01edffb1c 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.2.8 +// @version 1.2.9 // @author X.I.U // @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -30,7 +30,7 @@ ['https://download.fastgit.org','日本东京'], ['https://pd.zwc365.com/seturl','中国香港'], ['https://g.ioiox.com','中国香港'], - ['https://gh.con.sh','美国洛杉矶'] + ['https://github.xiu2.xyz','中国香港'] ], clone_url = [ 'https://hub.fastgit.org', @@ -40,8 +40,7 @@ raw_url = [ ['https://raw.githubusercontent.com','Github 原生',''], ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。 '], - ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '], - ['https://raw.githubusercontent.com','美国洛杉矶','注意:经过测试,该加速源存在文件格式限制,如果无法下载说明不支持该文件格式。 '] + ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '] ], svg = [ '', @@ -62,6 +61,9 @@ GM_unregisterMenuCommand(menu_feedBack_ID); menu_raw_fast = GM_getValue('xiu2_menu_raw_fast'); } + if(menu_raw_fast > raw_url.length - 1){ // 避免在减少 raw 数组后,用户储存的数据大于数组而报错 + menu_raw_fast = 0 + } menu_menu_raw_fast_ID = GM_registerMenuCommand(`🔄 [ ${raw_url[menu_raw_fast][1]} ] 加速源 (☁) - 点击切换`, menu_toggle_raw_fast); menu_feedBack_ID = GM_registerMenuCommand('💬 反馈 & 建议 [Github]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript', {active: true,insert: true,setParent: true});}); } @@ -200,13 +202,11 @@ href2 = href.replace('/blob/','/'), url = [ raw_url[1][0] + "/gh" + href.replace('/blob/','@'), - raw_url[2][0] + href2, - raw_url[3][0] + href2 + raw_url[2][0] + href2 ], html = ` ${raw_url[1][1]} ${raw_url[2][1]} -${raw_url[3][1]} `; $(this).after(html); }); @@ -264,11 +264,6 @@ url_name = raw_url[2][1]; url_tip = raw_url[2][2]; break; - case 3: - url = raw_url[3][0] + href2; - url_name = raw_url[3][1]; - url_tip = raw_url[3][2]; - break; } var html = ` `; $(cntElm_svg).after(html); From 3ac89bb94a4e6db1d0bfcdca6b103cbb37789fcb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 26 Dec 2020 17:00:35 +0800 Subject: [PATCH 0026/2377] update --- Zhihu-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 54744f8e2..9e13d75c2 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 知乎增强 // @version 1.2.1 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链、默认折叠邀请 +// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/static/favicon.ico From 6a6c50242b770719c81fcac6925ad8989c743335 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 27 Dec 2020 13:25:39 +0800 Subject: [PATCH 0027/2377] update --- GoogleTranslate-Beautification.user.js | 26 +++----------------------- Hostloc-Enhanced.user.js | 2 +- README.md | 2 +- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/GoogleTranslate-Beautification.user.js b/GoogleTranslate-Beautification.user.js index 2be5ff7f5..50ee4da6c 100644 --- a/GoogleTranslate-Beautification.user.js +++ b/GoogleTranslate-Beautification.user.js @@ -14,7 +14,7 @@ // @grant GM_notification // @license GPL-3.0 License // @run-at document-start -// @namespace https://greasyfork.org/scripts/413721 +// @namespace https://github.com/XIU2/UserScript // ==/UserScript== (function() { @@ -67,28 +67,8 @@ }`, style_2 = ` /* 清理多余内容 */ -.input-button-container,.ft-icon-row,.frame:before,.app-download-bar,#gb,.gp-footer,.feedback-link,#gt-input-tool { +.rQKk7.zJmlgc { display: none !important; -} -/* 主体顶部留白 */ -.homepage-content-wrap { - margin-top: 26px; -} -/* 部分元素的边框调整 */ -.gt-lc.gt-lc-mobile .gt-cd,.gt-lc.gt-lc-mobile.show-as-one-card { - border: .6px solid #eeeeee !important; - border-radius: 2px !important; -} -.main-header { - border: 1px solid #eee !important; - box-shadow: none !important; -} -.ls-wrap { - border-top: none !important; - border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important; -} -.results-container.empty { - border-left: 1px solid rgba(0, 0, 0, 0.06) !important; }`, style_Add = document.createElement('style'); if (menu_streamline) { @@ -97,6 +77,6 @@ style = style_1; } style_Add.innerHTML = style; - document.head.appendChild(style_Add); + document.head.appendChild(style_Add); } })(); \ No newline at end of file diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index a0adf095f..cd113a256 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 全球主机交流论坛增强 // @version 1.0.3 // @author X.I.U -// @description 自动无缝翻页 +// @description 自动无缝翻页、自动显示帖子内被隐藏的回复 // @match *://www.hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest diff --git a/README.md b/README.md index 6b9b424ff..db3020d22 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | | **吾爱破解论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/412681)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/412680)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| **全球主机交流论坛 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/414005)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[「安装」](https://greasyfork.org/scripts/414005)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[「安装」](https://greasyfork.org/scripts/397666)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! From 40261f4c84bb1df35a20497dbe2ba79cb3a791f5 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 27 Dec 2020 13:36:19 +0800 Subject: [PATCH 0028/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[423Down=20?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA]=20=E8=84=9A=E6=9C=AC=EF=BC=88=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 423Down-Enhanced.user.js | 203 +++++++++++++++++++++++++ GoogleTranslate-Beautification.user.js | 2 +- README.md | 1 + 3 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 423Down-Enhanced.user.js diff --git a/423Down-Enhanced.user.js b/423Down-Enhanced.user.js new file mode 100644 index 000000000..32e51ecb8 --- /dev/null +++ b/423Down-Enhanced.user.js @@ -0,0 +1,203 @@ +// ==UserScript== +// @name 423Down 增强 +// @version 1.0.0 +// @author X.I.U +// @description 自动无缝翻页 +// @match *://www.423down.com/* +// @exclude *://www.423down.com/*.html +// @icon https://www.423down.com/favicon.ico +// @grant GM_xmlhttpRequest +// @grant GM_registerMenuCommand +// @license GPL-3.0 License +// @run-at document-end +// @namespace https://github.com/XIU2/UserScript +// ==/UserScript== + +(function() { + // 注册脚本菜单 + GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript', {active: true,insert: true,setParent: true});}); + + // 默认 ID 为 0 + var curSite = {SiteTypeID: 0}; + + // 自动翻页规则 + let DBSite = { + postslist: { + SiteTypeID: 1, + pager: { + nextLink: '//div[@class="paging"]//a[contains(text(),"下一页")][@href]', + pageElement: 'css;div.content-wrap ul.excerpt > li', + HT_insert: ['css;div.content-wrap ul.excerpt', 2], + replaceE: 'css;div.paging', + } + } + }; + + // 用于脚本内部判断当前 URL 类型 + let SiteType = { + POSTSLIST: DBSite.postslist.SiteTypeID + }; + + curSite = DBSite.postslist; + curSite.pageUrl = ""; // 下一页URL + pageLoading(); // 自动翻页 + + + // 自动翻页 + function pageLoading() { + if (curSite.SiteTypeID > 0){ + windowScroll(function (direction, e) { + if (direction === "down") { // 下滑才准备翻页 + var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + let scrollDelta = 1299; + if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { + ShowPager.loadMorePage(); + } + } + }); + } + } + + + // 滚动条事件 + function windowScroll(fn1) { + var beforeScrollTop = document.documentElement.scrollTop, + fn = fn1 || function () {}; + setTimeout(function () { // 延时执行,避免刚载入到页面就触发翻页事件 + window.addEventListener("scroll", function (e) { + var afterScrollTop = document.documentElement.scrollTop, + delta = afterScrollTop - beforeScrollTop; + if (delta == 0) return false; + fn(delta > 0 ? "down" : "up", e); + beforeScrollTop = afterScrollTop; + }, false); + }, 1000) + } + + + var ShowPager = { // 修改自 https://greasyfork.org/scripts/14178 + getFullHref: function (e) { + if(e == null) return ''; + "string" != typeof e && (e = e.getAttribute("href")); + var t = this.getFullHref.a; + return t || (this.getFullHref.a = t = document.createElement("a")), t.href = e, t.href; + }, + createDocumentByString: function (e) { + if (e) { + if ("HTML" !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, "application/xhtml+xml"); + var t; + try { + t = (new DOMParser).parseFromString(e, "text/html"); + } catch (e) { + } + if (t) return t; + if (document.implementation.createHTMLDocument) t = document.implementation.createHTMLDocument("ADocument"); else try { + (t = document.cloneNode(!1)).appendChild(t.importNode(document.documentElement, !1)), + t.documentElement.appendChild(t.createElement("head")), t.documentElement.appendChild(t.createElement("body")); + } catch (e) { + } + if (t) { + var r = document.createRange(); + r.selectNodeContents(document.body); + var n = r.createContextualFragment(e); + t.body.appendChild(n); + for (var a, o = { + TITLE: !0, + META: !0, + LINK: !0, + STYLE: !0, + BASE: !0 + }, i = t.body, s = i.childNodes, c = s.length - 1; c >= 0; c--) o[(a = s[c]).nodeName] && i.removeChild(a); + return t; + } + } else console.error("没有找到要转成DOM的字符串"); + }, + loadMorePage: function () { + if (curSite.pager) { + let curPageEle = getElementByXpath(curSite.pager.nextLink); + var url = this.getFullHref(curPageEle); + //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + if(url === '') return; + if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 + curSite.pageUrl = url; + // 读取下一页的数据 + curSite.pager.startFilter && curSite.pager.startFilter(); + GM_xmlhttpRequest({ + url: url, + method: "GET", + timeout: 5000, + onload: function (response) { + try { + var newBody = ShowPager.createDocumentByString(response.responseText); + let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); + let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; + if (pageElems.length >= 0) { + let addTo = "beforeend"; + if (curSite.pager.HT_insert[1] == 1) addTo = "beforebegin"; + // 插入新页面元素 + pageElems.forEach(function (one) { + toElement.insertAdjacentElement(addTo, one); + }); + // 替换待替换元素 + try { + let oriE = getAllElements(curSite.pager.replaceE); + let repE = getAllElements(curSite.pager.replaceE, newBody, newBody); + if (oriE.length === repE.length) { + for (var i = 0; i < oriE.length; i++) { + oriE[i].outerHTML = repE[i].outerHTML; + } + } + } catch (e) { + console.log(e); + } + } + } catch (e) { + console.log(e); + } + } + }); + } + }, + }; + + + function getElementByXpath(e, t, r) { + r = r || document, t = t || r; + try { + return r.evaluate(e, t, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; + } catch (t) { + return void console.error("无效的xpath"); + } + } + + + function getAllElements(e, t, r, n, o) { + let getAllElementsByXpath = function(e, t, r) { + return r = r || document, t = t || r, r.evaluate(e, t, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + } + + var i, s = []; + if (!e) return s; + if (r = r || document, n = n || window, o = o || void 0, t = t || r, "string" == typeof e) i = 0 === e.search(/^css;/i) ? function getAllElementsByCSS(e, t) { + return (t || document).querySelectorAll(e); + }(e.slice(4), t) : getAllElementsByXpath(e, t, r); else { + if (!(i = e(r, n, o))) return s; + if (i.nodeType) return s[0] = i, s; + } + return function makeArray(e) { + var t, r, n, o = []; + if (e.pop) { + for (t = 0, r = e.length; t < r; t++) (n = e[t]) && (n.nodeType ? o.push(n) : o = o.concat(makeArray(n))); + return a()(o); + } + if (e.item) { + for (t = e.length; t;) o[--t] = e[t]; + return o; + } + if (e.iterateNext) { + for (t = e.snapshotLength; t;) o[--t] = e.snapshotItem(t); + return o; + } + }(i); + } +})(); \ No newline at end of file diff --git a/GoogleTranslate-Beautification.user.js b/GoogleTranslate-Beautification.user.js index 50ee4da6c..ed51b63af 100644 --- a/GoogleTranslate-Beautification.user.js +++ b/GoogleTranslate-Beautification.user.js @@ -14,7 +14,7 @@ // @grant GM_notification // @license GPL-3.0 License // @run-at document-start -// @namespace https://github.com/XIU2/UserScript +// @namespace https://greasyfork.org/scripts/413721 // ==/UserScript== (function() { diff --git a/README.md b/README.md index db3020d22..7eb49f97b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ | **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | From 7d70e8aafe30d45935dd5a056bb382820776e394 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 27 Dec 2020 14:06:39 +0800 Subject: [PATCH 0029/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[423Down=20?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA]=20=E8=84=9A=E6=9C=AC=EF=BC=88=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 423Down-Enhanced.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/423Down-Enhanced.user.js b/423Down-Enhanced.user.js index 32e51ecb8..6832e4254 100644 --- a/423Down-Enhanced.user.js +++ b/423Down-Enhanced.user.js @@ -8,6 +8,7 @@ // @icon https://www.423down.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand +// @grant GM_openInTab // @license GPL-3.0 License // @run-at document-end // @namespace https://github.com/XIU2/UserScript @@ -15,7 +16,7 @@ (function() { // 注册脚本菜单 - GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript', {active: true,insert: true,setParent: true});}); + GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; From 4110899166cfb25ab01b12020e6f9958d8e662f3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 27 Dec 2020 15:11:43 +0800 Subject: [PATCH 0030/2377] =?UTF-8?q?=E3=80=8C=E5=AE=89=E8=A3=85=E3=80=8D?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=94=B9=E4=B8=BA=E6=96=B0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7eb49f97b..7b6df72a9 100644 --- a/README.md +++ b/README.md @@ -11,23 +11,22 @@ ## 脚本列表 > 详细的脚本介绍、使用说明、截图,请点击第三列的 **「安装」** 前往 GreasyFork 查看。 -> 备用安装由 **`jsDelivr CDN`** 提供,优点是速度快(国内CDN),缺点是有 24小时缓存。 | 脚本名称 | 脚本功能 | 安装 | 备用 | | :---- | :---- | :----: | :----: | -| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **[「安装」](https://greasyfork.org/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **[「安装」](https://greasyfork.org/scripts/419081)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | -| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | -| **吾爱破解论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/412681)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/412680)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[「安装」](https://greasyfork.org/scripts/414005)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[「安装」](https://greasyfork.org/scripts/397666)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | +| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| **3DM论坛 美化** | 精简多余内容 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| **423Down 增强 \*** | 自动无缝翻页 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | +| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**「安装」**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | +| **吾爱破解论坛 美化** | 精简多余内容 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! > 所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过! From ae1408c9b0ed88661436ac22c0125e0a3b216c24 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 27 Dec 2020 15:18:20 +0800 Subject: [PATCH 0031/2377] update --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7b6df72a9..fc57b26c3 100644 --- a/README.md +++ b/README.md @@ -14,19 +14,19 @@ | 脚本名称 | 脚本功能 | 安装 | 备用 | | :---- | :---- | :----: | :----: | -| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| **3DM论坛 美化** | 精简多余内容 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| **423Down 增强 \*** | 自动无缝翻页 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | -| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**「安装」**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | -| **吾爱破解论坛 美化** | 精简多余内容 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **「安装」** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | +| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419081)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | +| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/zh-CN/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | +| **吾爱破解论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412681)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412680)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[「安装」](https://greasyfork.org/zh-CN/scripts/414005)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[「安装」](https://greasyfork.org/zh-CN/scripts/397666)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! > 所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过! From e5d6efa51f9e206893e5c83081948103e67536a3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 27 Dec 2020 19:00:11 +0800 Subject: [PATCH 0032/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=93=9D?= =?UTF-8?q?=E5=A5=8F=E4=BA=91=E7=BD=91=E7=9B=98=E5=A2=9E=E5=BC=BA]=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=88=E8=87=AA=E5=8A=A8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E6=96=87=E4=BB=B6=EF=BC=88=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E6=9C=AB=E5=B0=BE=E6=8C=89=E9=92=AE=EF=BC=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 41 insertions(+) create mode 100644 Lanzou-Enhanced.user.js diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js new file mode 100644 index 000000000..e64a4acec --- /dev/null +++ b/Lanzou-Enhanced.user.js @@ -0,0 +1,40 @@ +// ==UserScript== +// @name 蓝奏云网盘增强 +// @version 1.0.0 +// @author X.I.U +// @description 自动显示更多文件(文件夹末尾按钮) +// @match https://www.lanzou.com/account.php +// @match https://up.woozooo.com/mydisk.php* +// @icon https://www.lanzou.com/favicon.ico +// @grant GM_xmlhttpRequest +// @grant GM_registerMenuCommand +// @grant GM_openInTab +// @noframes +// @license GPL-3.0 License +// @run-at document-end +// @namespace https://github.com/XIU2/UserScript +// ==/UserScript== + +(function() { + // 如果位于 [https://www.lanzou.com/account.php] 网页,则跳转至 iframe 指向的 [https://up.woozooo.com/mydisk.php] 网页 + // 用来解决 iframe 跨域无法操作的问题,其实 [https://up.woozooo.com/mydisk.php] 还套了一个 iframe,但已经是同域可以操作了,没必要再跳转了 + if(window.top.location.href === "https://www.lanzou.com/account.php"){ + window.top.location.href = "https://up.woozooo.com/mydisk.php" + } + + // 注册脚本菜单 + GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + + // 自动显示更多文件 + function fileMore() { + var mainframe = document.getElementById("mainframe").contentWindow; + var filemore = mainframe.document.getElementById("filemore"); + if(filemore && filemore.style.display != "none"){ + if(filemore.children[0]){ + filemore.children[0].click(); + } + } + } + // 定时执行(为了确保不漏掉,只能用这个笨方法了。。。) + setInterval(fileMore,100) +})(); \ No newline at end of file diff --git a/README.md b/README.md index fc57b26c3..2fc4d51cb 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 自动显示更多文件(文件夹末尾按钮) | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/zh-CN/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | From 74d0d9716cddfc5dafef52049aa6361fe28f685e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 27 Dec 2020 20:23:24 +0800 Subject: [PATCH 0033/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=88=E6=89=A7=E8=A1=8C=E6=96=B9=E5=BC=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index e64a4acec..fc362ef47 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.0.0 +// @version 1.0.1 // @author X.I.U // @description 自动显示更多文件(文件夹末尾按钮) // @match https://www.lanzou.com/account.php @@ -25,9 +25,24 @@ // 注册脚本菜单 GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + + // 获取 iframe 框架 + var mainframe, + patt_mydisk=/mydisk\.php\?/; + if(patt_mydisk.test(window.top.location.href)){ + mainframe = window; // 如果当前位于最后一个套娃 iframe 本身,则不再需要寻找 iframe 框架,暂时没什么用,但是以后如果要增加其他功能可能用得上 + EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] + }else{ + mainframe = document.getElementById("mainframe"); + if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 + mainframe = mainframe.contentWindow; + EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] + } + } + + // 自动显示更多文件 function fileMore() { - var mainframe = document.getElementById("mainframe").contentWindow; var filemore = mainframe.document.getElementById("filemore"); if(filemore && filemore.style.display != "none"){ if(filemore.children[0]){ @@ -35,6 +50,19 @@ } } } - // 定时执行(为了确保不漏掉,只能用这个笨方法了。。。) - setInterval(fileMore,100) + + + // 定时执行(旧方法,每隔 100ms 执行一次,比较笨且浪费一丢丢性能,但优点是不会漏掉且反应更快) + //setInterval(fileMore,100); + + + // 监听 XMLHttpRequest 事件并执行(新方法,只有在产生事件时才会执行 [自动显示更多文件],平时不会执行,更优雅~) + function EventXMLHttpRequest() { + var _send = mainframe.XMLHttpRequest.prototype.send + function sendReplacement(data) { + setTimeout(fileMore, 200); // 延迟执行,避免网页还没加载完 + return _send.apply(this, arguments); + } + mainframe.XMLHttpRequest.prototype.send = sendReplacement; + } })(); \ No newline at end of file From 27bc7b3af124ffe65fa880349222258990eecd53 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 28 Dec 2020 12:29:04 +0800 Subject: [PATCH 0034/2377] =?UTF-8?q?=E5=B7=B2=E6=97=A0=E6=95=88=EF=BC=8C?= =?UTF-8?q?=E8=AF=B7=E5=8B=BF=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GoogleTranslate-Beautification.user.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GoogleTranslate-Beautification.user.js b/GoogleTranslate-Beautification.user.js index ed51b63af..9fec41fe3 100644 --- a/GoogleTranslate-Beautification.user.js +++ b/GoogleTranslate-Beautification.user.js @@ -56,20 +56,20 @@ function addStyle() { var style, style_1 = ` -/* 翻译结果的选择列表宽度 */ +/* 翻译结果的选择列表宽度 .alt-menu { max-width: 35% !important; -} -/* 翻译结果选择时显示翻译结果的翻译结果 */ +} */ +/* 翻译结果选择时显示翻译结果的翻译结果 .goog-menu.round-trip-content { white-space: normal !important; word-break: break-all !important; -}`, +} */`, style_2 = ` -/* 清理多余内容 */ +/* 清理多余内容 .rQKk7.zJmlgc { display: none !important; -}`, +} */`, style_Add = document.createElement('style'); if (menu_streamline) { style = style_1 + style_2; From 32a3e025ff6456492bc1fe5cc1fe472bec4f4074 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 29 Dec 2020 16:55:45 +0800 Subject: [PATCH 0035/2377] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=20[=E4=B8=AD?= =?UTF-8?q?=E5=9B=BD=E9=A6=99=E6=B8=AF]=20=E4=B8=BA=20[=E9=9F=A9=E5=9B=BD?= =?UTF-8?q?=E9=A6=96=E5=B0=94]=EF=BC=88=E8=BF=99=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E6=8D=A2=E6=9C=8D=E5=8A=A1=E5=99=A8=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 01edffb1c..7036d8e18 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.2.9 +// @version 1.3.0 // @author X.I.U // @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -25,13 +25,13 @@ fontColor = '#58A6FF'; } var download_url = [ - ['https://gh.con.sh','美国'], - ['https://gh.api.99988866.xyz','美国'], - ['https://download.fastgit.org','日本东京'], - ['https://pd.zwc365.com/seturl','中国香港'], - ['https://g.ioiox.com','中国香港'], - ['https://github.xiu2.xyz','中国香港'] - ], + ['https://gh.con.sh','美国'], + ['https://gh.api.99988866.xyz','美国'], + ['https://download.fastgit.org','日本东京'], + ['https://ghproxy.com/','韩国首尔'], + ['https://pd.zwc365.com/seturl','中国香港'], + ['https://github.xiu2.xyz','中国香港'] + ], clone_url = [ 'https://hub.fastgit.org', 'https://gitclone.com', From 9f475b2f98a9c5ebfbda4f87198c93c41a4bdb07 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 31 Dec 2020 12:47:24 +0800 Subject: [PATCH 0036/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=89=93=E5=BC=80=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=EF=BC=88=E7=82=B9=E5=87=BB=E6=96=87=E4=BB=B6=E6=97=B6=EF=BC=89?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD=EF=BC=9B=E4=BC=98=E5=8C=96=20=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F=E6=97=B6=E9=97=B4=EF=BC=88=E6=9B=B4=E4=B8=8D=E5=AE=B9?= =?UTF-8?q?=E6=98=93=E6=BC=8F=E6=8E=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 78 ++++++++++++++++++++++++++++++++++++----- README.md | 2 +- 2 files changed, 71 insertions(+), 9 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index fc362ef47..3d83332dc 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,14 +1,18 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.0.1 +// @version 1.0.2 // @author X.I.U -// @description 自动显示更多文件(文件夹末尾按钮) +// @description 自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时) // @match https://www.lanzou.com/account.php // @match https://up.woozooo.com/mydisk.php* // @icon https://www.lanzou.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand +// @grant GM_unregisterMenuCommand // @grant GM_openInTab +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_notification // @noframes // @license GPL-3.0 License // @run-at document-end @@ -22,8 +26,38 @@ window.top.location.href = "https://up.woozooo.com/mydisk.php" } + var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); + var menu_open_fileSha_ID, menu_feedBack_ID; + if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; + registerMenuCommand(); + // 注册脚本菜单 - GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + function registerMenuCommand() { + var menu_open_fileSha_; + if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 + GM_unregisterMenuCommand(menu_open_fileSha_ID); + GM_unregisterMenuCommand(menu_feedBack_ID); + menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); + } + + if (menu_open_fileSha){menu_open_fileSha_ = "√";}else{menu_open_fileSha_ = "×";} + + menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接(点击文件时)`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接(点击文件时)')}); + menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + } + + + // 菜单开关 + function menu_switch(menu_status, Name, Tips) { + if (menu_status){ + GM_setValue(`${Name}`, false); + GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`); + }else{ + GM_setValue(`${Name}`, true); + GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`); + } + registerMenuCommand(); // 重新注册脚本菜单 + }; // 获取 iframe 框架 @@ -43,10 +77,25 @@ // 自动显示更多文件 function fileMore() { - var filemore = mainframe.document.getElementById("filemore"); - if(filemore && filemore.style.display != "none"){ - if(filemore.children[0]){ - filemore.children[0].click(); + let filemore = mainframe.document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 + if(filemore && filemore.style.display == "block"){ // 判断按钮是否存在且可见 + if(filemore.children[0]){ // 判断按钮元素下第一个元素是否存在 + filemore.children[0].click(); // 点击 [显示更多文件] 按钮 + } + } + } + + + // 自动打开分享链接(点击文件时) + function fileSha() { + if(menu_open_fileSha){ // 脚本菜单开启时才继续 + var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框 + if(f_sha && f_sha.style.display == "block"){ // 判断信息框是否存在且可见 + let f_sha1 = mainframe.document.getElementById("f_sha1").innerText; // 获取分享链接(下载链接) + if(f_sha1 != ""){ // 确保分享链接(下载链接)不是空 + f_sha.style.display = "none"; // 隐藏分享链接(下载链接)信息框 + window.GM_openInTab(f_sha1, {active: true,insert: true,setParent: true}) // 打开分享链接(下载链接) + } } } } @@ -60,9 +109,22 @@ function EventXMLHttpRequest() { var _send = mainframe.XMLHttpRequest.prototype.send function sendReplacement(data) { - setTimeout(fileMore, 200); // 延迟执行,避免网页还没加载完 + setTimeout(fileMore, 300); // 自动显示更多文件 + setTimeout(fileSha, 300); // 自动打开分享链接(点击文件时) return _send.apply(this, arguments); } mainframe.XMLHttpRequest.prototype.send = sendReplacement; } + + + /*(function (open) { + mainframe.XMLHttpRequest.prototype.open = function () { + this.addEventListener("readystatechange", function () { + if(this.responseURL != "") { + console.log(this.responseURL); + } + }, false); + open.apply(this, arguments); + }; + })(mainframe.XMLHttpRequest.prototype.open);*/ })(); \ No newline at end of file diff --git a/README.md b/README.md index 2fc4d51cb..df8ad43df 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 自动显示更多文件(文件夹末尾按钮) | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 自动显示更多文件、自动打开分享链接(点击文件时)... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/zh-CN/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | From 8919969f44e9f1e850b272375d4ad16073fe7ff1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 31 Dec 2020 13:58:34 +0800 Subject: [PATCH 0037/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=9B=A0?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E5=8C=B9=E9=85=8D=E9=83=A8=E5=88=86=E8=93=9D?= =?UTF-8?q?=E5=A5=8F=E4=BA=91=E5=90=8E=E5=8F=B0=E5=9C=B0=E5=9D=80=E8=80=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=8A=9F=E8=83=BD=E5=A4=B1=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=88=E8=93=9D=E5=A5=8F=E4=BA=91=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E5=9C=B0=E5=9D=80=E4=B9=9F=E5=A4=AA=E5=A4=9A=E4=BA=86?= =?UTF-8?q?=E5=91=80=EF=BC=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 3d83332dc..d8766db7d 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,10 +1,14 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.0.2 +// @version 1.0.3 // @author X.I.U // @description 自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时) -// @match https://www.lanzou.com/account.php -// @match https://up.woozooo.com/mydisk.php* +// @match *://www.lanzou.com/account.php +// @match *://www.lanzou.com/u +// @match *://up.woozooo.com/u +// @match *://up.woozooo.com/mydisk.php* +// @match *://pc.woozooo.com/u +// @match *://pc.woozooo.com/mydisk.php* // @icon https://www.lanzou.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -20,10 +24,8 @@ // ==/UserScript== (function() { - // 如果位于 [https://www.lanzou.com/account.php] 网页,则跳转至 iframe 指向的 [https://up.woozooo.com/mydisk.php] 网页 - // 用来解决 iframe 跨域无法操作的问题,其实 [https://up.woozooo.com/mydisk.php] 还套了一个 iframe,但已经是同域可以操作了,没必要再跳转了 - if(window.top.location.href === "https://www.lanzou.com/account.php"){ - window.top.location.href = "https://up.woozooo.com/mydisk.php" + if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){ + window.top.location.href = "https://pc.woozooo.com/mydisk.php" } var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); @@ -61,17 +63,11 @@ // 获取 iframe 框架 - var mainframe, - patt_mydisk=/mydisk\.php\?/; - if(patt_mydisk.test(window.top.location.href)){ - mainframe = window; // 如果当前位于最后一个套娃 iframe 本身,则不再需要寻找 iframe 框架,暂时没什么用,但是以后如果要增加其他功能可能用得上 + var mainframe + mainframe = document.getElementById("mainframe"); + if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 + mainframe = mainframe.contentWindow; EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] - }else{ - mainframe = document.getElementById("mainframe"); - if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 - mainframe = mainframe.contentWindow; - EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] - } } @@ -109,8 +105,8 @@ function EventXMLHttpRequest() { var _send = mainframe.XMLHttpRequest.prototype.send function sendReplacement(data) { - setTimeout(fileMore, 300); // 自动显示更多文件 - setTimeout(fileSha, 300); // 自动打开分享链接(点击文件时) + setTimeout(fileMore, 200); // 自动显示更多文件 + setTimeout(fileSha, 200); // 自动打开分享链接(点击文件时) return _send.apply(this, arguments); } mainframe.XMLHttpRequest.prototype.send = sendReplacement; From bafa5b3345322bbd8f1359c80dec684a1f2de6d7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 31 Dec 2020 19:14:36 +0800 Subject: [PATCH 0038/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9/=E6=96=87=E4=BB=B6=E6=9C=89=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=97=B6=20[=E8=87=AA=E5=8A=A8=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5]=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index d8766db7d..6e110153e 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.0.3 +// @version 1.0.4 // @author X.I.U // @description 自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时) // @match *://www.lanzou.com/account.php @@ -87,10 +87,10 @@ if(menu_open_fileSha){ // 脚本菜单开启时才继续 var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框 if(f_sha && f_sha.style.display == "block"){ // 判断信息框是否存在且可见 - let f_sha1 = mainframe.document.getElementById("f_sha1").innerText; // 获取分享链接(下载链接) - if(f_sha1 != ""){ // 确保分享链接(下载链接)不是空 + let code = mainframe.document.getElementById("code").getAttribute("title"); // 获取分享链接(下载链接) + if(code != ""){ // 确保分享链接(下载链接)不是空 f_sha.style.display = "none"; // 隐藏分享链接(下载链接)信息框 - window.GM_openInTab(f_sha1, {active: true,insert: true,setParent: true}) // 打开分享链接(下载链接) + window.GM_openInTab(code, {active: true,insert: true,setParent: true}) // 打开分享链接(下载链接) } } } From 361b76a2647bd28aa8baa75a453c321b14b52823 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 1 Jan 2021 11:21:30 +0800 Subject: [PATCH 0039/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=A4=8D=E5=88=B6=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5?= =?UTF-8?q?]=EF=BC=88=E7=82=B9=E5=87=BB=E6=96=87=E4=BB=B6=E6=97=B6?= =?UTF-8?q?=EF=BC=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 69 +++++++++++++++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 6e110153e..16d436f8c 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.0.4 +// @version 1.0.5 // @author X.I.U -// @description 自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时) +// @description 自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时) // @match *://www.lanzou.com/account.php // @match *://www.lanzou.com/u // @match *://up.woozooo.com/u @@ -29,22 +29,28 @@ } var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); - var menu_open_fileSha_ID, menu_feedBack_ID; + var menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); + var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_feedBack_ID; if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; + if (menu_copy_fileSha == null){menu_copy_fileSha = true; GM_setValue('xiu2_menu_copy_fileSha', menu_copy_fileSha)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_open_fileSha_; + var menu_open_fileSha_, menu_copy_fileSha_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_open_fileSha_ID); + GM_unregisterMenuCommand(menu_copy_fileSha_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); + menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); } if (menu_open_fileSha){menu_open_fileSha_ = "√";}else{menu_open_fileSha_ = "×";} + if (menu_copy_fileSha){menu_copy_fileSha_ = "√";}else{menu_copy_fileSha_ = "×";} - menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接(点击文件时)`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接(点击文件时)')}); + menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接(点击文件时)`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接')}); + menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接(点击文件时)`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接')}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -82,21 +88,58 @@ } - // 自动打开分享链接(点击文件时) + // 分享链接相关(点击文件时) function fileSha() { + var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框 + if(f_sha && f_sha.style.display == "block"){ // 判断信息框是否存在且可见 + fileSha_Open(); // 自动打开分享链接(点击文件时) + fileSha_Copy(); // 自动复制分享链接(点击文件时) + if(menu_open_fileSha || menu_copy_fileSha){ + f_sha.style.display = "none"; // 隐藏分享链接(下载链接)信息框 + } + } + } + + + // 自动打开分享链接(点击文件时) + function fileSha_Open() { if(menu_open_fileSha){ // 脚本菜单开启时才继续 - var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框 - if(f_sha && f_sha.style.display == "block"){ // 判断信息框是否存在且可见 - let code = mainframe.document.getElementById("code").getAttribute("title"); // 获取分享链接(下载链接) - if(code != ""){ // 确保分享链接(下载链接)不是空 - f_sha.style.display = "none"; // 隐藏分享链接(下载链接)信息框 - window.GM_openInTab(code, {active: true,insert: true,setParent: true}) // 打开分享链接(下载链接) - } + let code = mainframe.document.getElementById("code").getAttribute("title"); // 获取分享链接(下载链接) + if(code != ""){ // 确保分享链接(下载链接)不是空 + window.GM_openInTab(code, {active: true,insert: true,setParent: true}) // 打开分享链接(下载链接) } } } + // 自动复制分享链接(点击文件时) + function fileSha_Copy() { + if(menu_copy_fileSha){ // 脚本菜单开启时才继续 + let f_sha1 = mainframe.document.getElementById("f_sha1").innerText; // 获取分享链接(下载链接) + if(f_sha1 != ""){ // 确保分享链接(下载链接)不是空 + copyToClipboard(f_sha1); // 复制到剪切板 + } + } + } + + + // 复制到剪切板 + function copyToClipboard(s){ + if(window.clipboardData){ + window.clipboardData.setData('text',s); + }else{ + (function(s){ + document.oncopy=function(e){ + e.clipboardData.setData('text',s); + e.preventDefault(); + document.oncopy=null; + } + })(s); + document.execCommand('Copy'); + } + } + + // 定时执行(旧方法,每隔 100ms 执行一次,比较笨且浪费一丢丢性能,但优点是不会漏掉且反应更快) //setInterval(fileMore,100); From e9a6815ddb0d0ff9bb0b9dc6e9e2afe61d6b92a9 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 1 Jan 2021 16:36:42 +0800 Subject: [PATCH 0040/2377] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df8ad43df..453f7437a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 自动显示更多文件、自动打开分享链接(点击文件时)... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 自动显示更多文件、自动复制/打开分享链接(点击文件时)... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/zh-CN/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | From 7889bf44a818da74dfd700a9cd583bfaba02c273 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 1 Jan 2021 16:58:55 +0800 Subject: [PATCH 0041/2377] update --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 453f7437a..5cc572112 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ > 如果你只有 GreasyFork 账号,也可以前往 GreasyFork 脚本页面向我反馈! +> _另一个开源项目:[**CloudflareSpeedTest** - 🌩 测试 Cloudflare CDN 延迟和速度,获取最快 IP (IPv4+IPv6)!](https://github.com/XIU2/CloudflareSpeedTest)_ + ## 脚本列表 > 详细的脚本介绍、使用说明、截图,请点击第三列的 **「安装」** 前往 GreasyFork 查看。 @@ -23,7 +25,7 @@ | **蓝奏云网盘 增强 \*** | 自动显示更多文件、自动复制/打开分享链接(点击文件时)... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://greasyfork.org/zh-CN/scripts/413721)**_~~ | ~~_**[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GoogleTranslate-Beautification.user.js)**_~~ | +| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | **吾爱破解论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412681)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412680)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[「安装」](https://greasyfork.org/zh-CN/scripts/414005)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | From 87f07f9c9fb66b9c88e0e18af59664f02bd64f7f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 2 Jan 2021 10:58:15 +0800 Subject: [PATCH 0042/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=BD=91=E9=A1=B5=E8=B7=AF=E5=BE=84=E4=B8=8D=E5=8F=98?= =?UTF-8?q?=EF=BC=88F5=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 66 ++++++++++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 16d436f8c..ba784c510 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.0.5 +// @version 1.0.6 // @author X.I.U -// @description 自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时) +// @description 刷新网页路径不变(F5)、自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时) // @match *://www.lanzou.com/account.php // @match *://www.lanzou.com/u // @match *://up.woozooo.com/u @@ -22,7 +22,6 @@ // @run-at document-end // @namespace https://github.com/XIU2/UserScript // ==/UserScript== - (function() { if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){ window.top.location.href = "https://pc.woozooo.com/mydisk.php" @@ -30,39 +29,50 @@ var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); var menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); - var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_feedBack_ID; + var menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'); + var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_feedBack_ID; if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; if (menu_copy_fileSha == null){menu_copy_fileSha = true; GM_setValue('xiu2_menu_copy_fileSha', menu_copy_fileSha)}; + if (menu_refreshCorrection == null){menu_refreshCorrection = true; GM_setValue('xiu2_menu_refreshCorrection', menu_refreshCorrection)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_open_fileSha_, menu_copy_fileSha_; + var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_open_fileSha_ID); GM_unregisterMenuCommand(menu_copy_fileSha_ID); - GM_unregisterMenuCommand(menu_feedBack_ID); + GM_unregisterMenuCommand(menu_copy_fileSha_ID); + GM_unregisterMenuCommand(menu_refreshCorrection_ID); menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); + menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'); } if (menu_open_fileSha){menu_open_fileSha_ = "√";}else{menu_open_fileSha_ = "×";} if (menu_copy_fileSha){menu_copy_fileSha_ = "√";}else{menu_copy_fileSha_ = "×";} + if (menu_refreshCorrection){menu_refreshCorrection_ = "√";}else{menu_refreshCorrection_ = "×";} - menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接(点击文件时)`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接')}); - menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接(点击文件时)`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接')}); + menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接(点击文件时)`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); + menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接(点击文件时)`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); + menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新网页路径不变(F5)`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新网页路径不变', false)}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } // 菜单开关 - function menu_switch(menu_status, Name, Tips) { + function menu_switch(menu_status, Name, Tips, RefreshTips) { + if(RefreshTips){ + RefreshTips = "\n(刷新网页后生效)" + }else{ + RefreshTips = "" + } if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification(`已关闭 [${Tips}] 功能${RefreshTips}`); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification(`已开启 [${Tips}] 功能${RefreshTips}`); } registerMenuCommand(); // 重新注册脚本菜单 }; @@ -73,10 +83,44 @@ mainframe = document.getElementById("mainframe"); if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 mainframe = mainframe.contentWindow; + if(menu_refreshCorrection){ + refreshCorrection(); // 刷新网页路径不变(F5) + } EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] } + // 刷新网页路径不变(F5) + function refreshCorrection() { + document.onkeydown = mainframe.onkeydown = function (e) { + e = window.event || e; + let keycode = e.keyCode; + if (keycode == 116) { + e.keyCode = 0; + let folderID = /-?\d+/.exec(mainframe.document.getElementById("filemore").children[0].getAttribute("onclick")) + if(folderID.length > 0){ + mainframe.folder(folderID[0]); + e.returnValue = false; + e.cancelBubble = true; + return false; + } + } + } + } + + + // 恢复刷新机制 + function UNrefreshCorrection() { + document.onkeydown = mainframe.onkeydown = function (e) { + e = window.event || e; + let keycode = e.keyCode; + if (keycode == 116) { + return true; + } + } + } + + // 自动显示更多文件 function fileMore() { let filemore = mainframe.document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 From 513ac98cdd0b1efcc75d35e32a3d79f0e6446cbe Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 2 Jan 2021 11:15:27 +0800 Subject: [PATCH 0043/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E4=B8=8D=E8=BF=94=E5=9B=9E=E6=A0=B9=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=EF=BC=88F5=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index ba784c510..ef2c6709f 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 蓝奏云网盘增强 // @version 1.0.6 // @author X.I.U -// @description 刷新网页路径不变(F5)、自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时) +// @description 刷新不返回根目录(F5)、自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时) // @match *://www.lanzou.com/account.php // @match *://www.lanzou.com/u // @match *://up.woozooo.com/u @@ -55,7 +55,7 @@ menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接(点击文件时)`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接(点击文件时)`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); - menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新网页路径不变(F5)`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新网页路径不变', false)}); + menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新不返回根目录(F5)`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新不返回根目录', false)}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -84,13 +84,13 @@ if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 mainframe = mainframe.contentWindow; if(menu_refreshCorrection){ - refreshCorrection(); // 刷新网页路径不变(F5) + refreshCorrection(); // 刷新不返回根目录(F5) } EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] } - // 刷新网页路径不变(F5) + // 刷新不返回根目录(F5) function refreshCorrection() { document.onkeydown = mainframe.onkeydown = function (e) { e = window.event || e; From 07db05905e15624da5bf016af0c0cbfcd3041404 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 2 Jan 2021 12:00:34 +0800 Subject: [PATCH 0044/2377] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cc572112..cbe99190c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 自动显示更多文件、自动复制/打开分享链接(点击文件时)... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 刷新不回根目录、自动显示更多文件、自动打开分享链接... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | From 9c6c4435a6aeb433f01bb68f31432d6ab8f6395c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 3 Jan 2021 10:31:03 +0800 Subject: [PATCH 0045/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=98=BE=E7=A4=BA=E6=9B=B4=E5=A4=9A=E6=96=87=E4=BB=B6?= =?UTF-8?q?]=20=E6=94=AF=E6=8C=81=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=97=E8=A1=A8=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 48 ++++++++++++++++++++++++++++++----------- README.md | 2 +- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index ef2c6709f..6819ee8ec 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,11 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.0.6 +// @version 1.0.7 // @author X.I.U -// @description 刷新不返回根目录(F5)、自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时) +// @description 刷新不返回根目录(F5)、自动显示更多文件、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时) +// @match *://*.lanzous.com/* +// @match *://*.lanzoux.com/* +// @match *://*.lanzoui.com/* // @match *://www.lanzou.com/account.php // @match *://www.lanzou.com/u // @match *://up.woozooo.com/u @@ -23,10 +26,6 @@ // @namespace https://github.com/XIU2/UserScript // ==/UserScript== (function() { - if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){ - window.top.location.href = "https://pc.woozooo.com/mydisk.php" - } - var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); var menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); var menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'); @@ -78,15 +77,29 @@ }; + if(document.getElementById("infos")){ // 分享链接文件列表页 + setTimeout(fileMoreS, 300); // 自动显示更多文件 + }else if(document.querySelector("iframe.ifr2")){ // 分享链接文件下载页(暂时没有这方面的功能,先空着) + //console.log() + }else if(document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1){ // 后台页 + if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){ + window.top.location.href = "https://pc.woozooo.com/mydisk.php" + } + var mainframe; + iframe(); + } + + // 获取 iframe 框架 - var mainframe - mainframe = document.getElementById("mainframe"); - if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 - mainframe = mainframe.contentWindow; - if(menu_refreshCorrection){ - refreshCorrection(); // 刷新不返回根目录(F5) + function iframe() { + mainframe = document.getElementById("mainframe"); + if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 + mainframe = mainframe.contentWindow; + if(menu_refreshCorrection){ + refreshCorrection(); // 刷新不返回根目录(F5) + } + EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] } - EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] } @@ -132,6 +145,15 @@ } + // 自动显示更多文件 + function fileMoreS() { + let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 + if(filemore && filemore.style.display != "none"){ // 判断按钮是否存在且可见 + filemore.click(); // 点击 [显示更多文件] 按钮 + } + } + + // 分享链接相关(点击文件时) function fileSha() { var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框 diff --git a/README.md b/README.md index cbe99190c..3231d2262 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 刷新不回根目录、自动显示更多文件、自动打开分享链接... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 刷新不回根目录、自动显示更多文件、自动复制分享链接... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | From b7613e0e1f1069d8fa49acc2b054bacaa0bef342 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 3 Jan 2021 15:01:22 +0800 Subject: [PATCH 0046/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=BB=86?= =?UTF-8?q?=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 6819ee8ec..fc0441380 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 蓝奏云网盘增强 // @version 1.0.7 // @author X.I.U -// @description 刷新不返回根目录(F5)、自动显示更多文件、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时) +// @description 刷新不返回根目录、自动显示更多文件、自动打开分享链接、自动复制分享链接 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -52,9 +52,9 @@ if (menu_copy_fileSha){menu_copy_fileSha_ = "√";}else{menu_copy_fileSha_ = "×";} if (menu_refreshCorrection){menu_refreshCorrection_ = "√";}else{menu_refreshCorrection_ = "×";} - menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接(点击文件时)`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); - menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接(点击文件时)`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); - menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新不返回根目录(F5)`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新不返回根目录', false)}); + menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); + menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); + menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新不返回根目录`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新不返回根目录', false)}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } From 4327c15dd27c69a40635ada3ee3395c2448d7580 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 3 Jan 2021 17:31:26 +0800 Subject: [PATCH 0047/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=8F=B3=E9=94=AE=E6=98=BE=E7=A4=BA=E8=8F=9C=E5=8D=95?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD=EF=BC=88=E4=B8=8D=E7=94=A8=E8=B4=B9?= =?UTF-8?q?=E5=8A=B2=E5=8E=BB=E7=82=B9=E5=B0=8F=E5=B0=8F=E7=9A=84=20[...]?= =?UTF-8?q?=20=E6=8C=89=E9=92=AE=E4=BA=86=EF=BC=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 72 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index fc0441380..015def49a 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.0.7 +// @version 1.1.0 // @author X.I.U -// @description 刷新不返回根目录、自动显示更多文件、自动打开分享链接、自动复制分享链接 +// @description 刷新不返回根目录、文件右键显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -26,35 +26,41 @@ // @namespace https://github.com/XIU2/UserScript // ==/UserScript== (function() { - var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); - var menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); - var menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'); - var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_feedBack_ID; + var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'), + menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'), + menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'), + menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'); + var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_feedBack_ID; if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; if (menu_copy_fileSha == null){menu_copy_fileSha = true; GM_setValue('xiu2_menu_copy_fileSha', menu_copy_fileSha)}; if (menu_refreshCorrection == null){menu_refreshCorrection = true; GM_setValue('xiu2_menu_refreshCorrection', menu_refreshCorrection)}; + if (menu_rightClickMenu == null){menu_rightClickMenu = true; GM_setValue('xiu2_menu_rightClickMenu', menu_rightClickMenu)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_; + var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_, menu_rightClickMenu_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_open_fileSha_ID); GM_unregisterMenuCommand(menu_copy_fileSha_ID); - GM_unregisterMenuCommand(menu_copy_fileSha_ID); GM_unregisterMenuCommand(menu_refreshCorrection_ID); + GM_unregisterMenuCommand(menu_rightClickMenu_ID); + GM_unregisterMenuCommand(menu_feedBack_ID); menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'); + menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'); } if (menu_open_fileSha){menu_open_fileSha_ = "√";}else{menu_open_fileSha_ = "×";} if (menu_copy_fileSha){menu_copy_fileSha_ = "√";}else{menu_copy_fileSha_ = "×";} if (menu_refreshCorrection){menu_refreshCorrection_ = "√";}else{menu_refreshCorrection_ = "×";} + if (menu_rightClickMenu){menu_rightClickMenu_ = "√";}else{menu_rightClickMenu_ = "×";} menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新不返回根目录`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新不返回根目录', false)}); + menu_rightClickMenu_ID = GM_registerMenuCommand(`[ ${menu_rightClickMenu_} ] 文件右键显示菜单`, function(){menu_switch(menu_rightClickMenu,'xiu2_menu_rightClickMenu','文件右键显示菜单', true)}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -134,6 +140,55 @@ } + // 文件右键显示菜单 + function rightClickMenu() { + if(menu_rightClickMenu){ // 脚本菜单开启时才继续 + var folder_list = mainframe.document.getElementById("sub_folder_list"); + if(folder_list){ // 文件夹列表 + folder_list.oncontextmenu = function(e){ + e.preventDefault(); // 屏蔽浏览器自身右键菜单 + let folder_list_ID = e.target.id; + //console.log(e.target.nodeName) + //console.log(e.target.className) + //console.log(e.target.id) + if(e.target.nodeName == "FONT") + { + folder_list_ID = e.target.parentNode.parentNode.id + }else if(e.target.id == ""){ + folder_list_ID = e.target.parentNode.id + } + folder_list_ID = /\d+/.exec(folder_list_ID) + if(folder_list_ID.length > 0){ + mainframe.document.getElementById("folse" + folder_list_ID[0]).focus(); + mainframe.document.getElementById("folse" + folder_list_ID[0]).click(); + } + } + } + var file_list = mainframe.document.getElementById("filelist"); + if(file_list){ // 文件列表 + file_list.oncontextmenu = function(e){ + e.preventDefault(); // 屏蔽浏览器自身右键菜单 + let file_list_ID = e.target.id; + //console.log(e.target.nodeName) + //console.log(e.target.className) + //console.log(e.target.id) + if(e.target.nodeName == "FONT") + { + file_list_ID = e.target.parentNode.parentNode.id + }else if(e.target.id == ""){ + file_list_ID = e.target.parentNode.id + } + file_list_ID = /\d+/.exec(file_list_ID) + if(file_list_ID.length > 0){ + mainframe.document.getElementById("fse" + file_list_ID[0]).focus(); + mainframe.document.getElementById("fse" + file_list_ID[0]).click(); + } + } + } + } + } + + // 自动显示更多文件 function fileMore() { let filemore = mainframe.document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 @@ -216,6 +271,7 @@ function sendReplacement(data) { setTimeout(fileMore, 200); // 自动显示更多文件 setTimeout(fileSha, 200); // 自动打开分享链接(点击文件时) + setTimeout(rightClickMenu, 500); // 右键菜单 return _send.apply(this, arguments); } mainframe.XMLHttpRequest.prototype.send = sendReplacement; From c7d5191f66484790da7e9c3c508613e54e1f7f32 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 3 Jan 2021 17:44:26 +0800 Subject: [PATCH 0048/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E6=96=87=E4=BB=B6=E6=98=BE=E7=A4=BA=E8=8F=9C=E5=8D=95?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD=EF=BC=88=E4=B8=8D=E7=94=A8=E8=B4=B9?= =?UTF-8?q?=E5=8A=B2=E5=8E=BB=E7=82=B9=E5=B0=8F=E5=B0=8F=E7=9A=84=20[...]?= =?UTF-8?q?=20=E6=8C=89=E9=92=AE=E4=BA=86=EF=BC=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 015def49a..9018c73a5 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 蓝奏云网盘增强 // @version 1.1.0 // @author X.I.U -// @description 刷新不返回根目录、文件右键显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接 +// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -60,7 +60,7 @@ menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新不返回根目录`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新不返回根目录', false)}); - menu_rightClickMenu_ID = GM_registerMenuCommand(`[ ${menu_rightClickMenu_} ] 文件右键显示菜单`, function(){menu_switch(menu_rightClickMenu,'xiu2_menu_rightClickMenu','文件右键显示菜单', true)}); + menu_rightClickMenu_ID = GM_registerMenuCommand(`[ ${menu_rightClickMenu_} ] 右键文件显示菜单`, function(){menu_switch(menu_rightClickMenu,'xiu2_menu_rightClickMenu','右键文件显示菜单', true)}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -140,7 +140,7 @@ } - // 文件右键显示菜单 + // 右键文件显示菜单 function rightClickMenu() { if(menu_rightClickMenu){ // 脚本菜单开启时才继续 var folder_list = mainframe.document.getElementById("sub_folder_list"); @@ -271,7 +271,7 @@ function sendReplacement(data) { setTimeout(fileMore, 200); // 自动显示更多文件 setTimeout(fileSha, 200); // 自动打开分享链接(点击文件时) - setTimeout(rightClickMenu, 500); // 右键菜单 + setTimeout(rightClickMenu, 500); // 右键文件显示菜单 return _send.apply(this, arguments); } mainframe.XMLHttpRequest.prototype.send = sendReplacement; From 6b60328927fab9cea6ed481dbdbf5b0def1f68f1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 4 Jan 2021 09:10:35 +0800 Subject: [PATCH 0049/2377] =?UTF-8?q?=E6=94=B9=E5=90=8D=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=BA[=E8=87=AA=E5=8A=A8=E6=97=A0=E7=BC=9D?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5]=EF=BC=9B=E6=96=B0=E5=A2=9E=20[Apphot(?= =?UTF-8?q?=E5=8E=9F=E7=83=88=E7=81=AB=E6=B1=89=E5=8C=96)]=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 423Down-Enhanced.user.js => Autopage.user.js | 43 +++++++++++++++----- README.md | 2 +- 2 files changed, 33 insertions(+), 12 deletions(-) rename 423Down-Enhanced.user.js => Autopage.user.js (84%) diff --git a/423Down-Enhanced.user.js b/Autopage.user.js similarity index 84% rename from 423Down-Enhanced.user.js rename to Autopage.user.js index 6832e4254..12c00f205 100644 --- a/423Down-Enhanced.user.js +++ b/Autopage.user.js @@ -1,11 +1,13 @@ // ==UserScript== -// @name 423Down 增强 -// @version 1.0.0 +// @name 自动无缝翻页 +// @version 1.1.0 // @author X.I.U -// @description 自动无缝翻页 +// @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化) // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html -// @icon https://www.423down.com/favicon.ico +// @match *://apphot.cc/* +// @exclude *://apphot.cc/*.html +// @icon https://github.githubassets.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_openInTab @@ -16,41 +18,60 @@ (function() { // 注册脚本菜单 - GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + GM_registerMenuCommand('反馈 & 申请添加支持', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; // 自动翻页规则 let DBSite = { - postslist: { + postslist_423down: { SiteTypeID: 1, pager: { nextLink: '//div[@class="paging"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div.content-wrap ul.excerpt > li', HT_insert: ['css;div.content-wrap ul.excerpt', 2], replaceE: 'css;div.paging', + scrollDelta: 1300 + } + }, + postslist_apphot: { + SiteTypeID: 2, + pager: { + nextLink: '//div[@class="pagination"]//a[contains(text(),"下一页")][@href]', + pageElement: 'css;div.content > article.excerpt', + HT_insert: ['css;div.pagination', 1], + replaceE: 'css;div.pagination', + scrollDelta: 1500 } } }; // 用于脚本内部判断当前 URL 类型 let SiteType = { - POSTSLIST: DBSite.postslist.SiteTypeID + POSTSLIST_423DOWN: DBSite.postslist_423down.SiteTypeID, + POSTSLIST_APPHOT: DBSite.postslist_apphot.SiteTypeID }; - curSite = DBSite.postslist; + switch (location.host) { + case "www.423down.com": + curSite = DBSite.postslist_423down; + break; + case "apphot.cc": + curSite = DBSite.postslist_apphot; + break; + } curSite.pageUrl = ""; // 下一页URL - pageLoading(); // 自动翻页 + pageLoading(); // 自动无缝翻页 - // 自动翻页 + // 自动无缝翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; - let scrollDelta = 1299; + let scrollDelta = curSite.pager.scrollDelta; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { ShowPager.loadMorePage(); } diff --git a/README.md b/README.md index 3231d2262..91f8ef1a5 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419081)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** | | **蓝奏云网盘 增强 \*** | 刷新不回根目录、自动显示更多文件、自动复制分享链接... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | From 4cab278de9b5b28c228f3df93c732f623d1cc3dc Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 4 Jan 2021 09:43:53 +0800 Subject: [PATCH 0050/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B0=8F?= =?UTF-8?q?=E4=BC=97=E8=BD=AF=E4=BB=B6]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 23 ++++++++++++++++++++--- README.md | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 12c00f205..e564a6d54 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,12 +1,15 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.0 +// @version 1.1.1 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化) +// @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化)、小众软件 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* // @exclude *://apphot.cc/*.html +// @match *://www.appinn.com/ +// @match *://www.appinn.com/*/*/ +// @match *://www.appinn.com/?s=* // @icon https://github.githubassets.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -44,13 +47,24 @@ replaceE: 'css;div.pagination', scrollDelta: 1500 } + }, + postslist_appinn: { + SiteTypeID: 3, + pager: { + nextLink: '//a[@class="next page-numbers"][@href]', + pageElement: 'css;section#latest-posts > article', + HT_insert: ['css;nav.navigation.pagination', 1], + replaceE: 'css;div.nav-links', + scrollDelta: 1500 + } } }; // 用于脚本内部判断当前 URL 类型 let SiteType = { POSTSLIST_423DOWN: DBSite.postslist_423down.SiteTypeID, - POSTSLIST_APPHOT: DBSite.postslist_apphot.SiteTypeID + POSTSLIST_APPHOT: DBSite.postslist_apphot.SiteTypeID, + POSTSLIST_APPINN: DBSite.postslist_appinn.SiteTypeID }; switch (location.host) { @@ -60,6 +74,9 @@ case "apphot.cc": curSite = DBSite.postslist_apphot; break; + case "www.appinn.com": + curSite = DBSite.postslist_appinn; + break; } curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动无缝翻页 diff --git a/README.md b/README.md index 91f8ef1a5..6cacf3a51 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419081)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | **蓝奏云网盘 增强 \*** | 刷新不回根目录、自动显示更多文件、自动复制分享链接... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | From 49662de54bae976b69db34799936556dfb092121 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 4 Jan 2021 09:47:19 +0800 Subject: [PATCH 0051/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B0=8F?= =?UTF-8?q?=E4=BC=97=E8=BD=AF=E4=BB=B6]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Autopage.user.js b/Autopage.user.js index e564a6d54..57ede06c2 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -55,7 +55,7 @@ pageElement: 'css;section#latest-posts > article', HT_insert: ['css;nav.navigation.pagination', 1], replaceE: 'css;div.nav-links', - scrollDelta: 1500 + scrollDelta: 1300 } } }; From 26605e7f5e53c06bccce085379c72d17a02a49f9 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:21:16 +0800 Subject: [PATCH 0052/2377] update --- README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 6cacf3a51..7fd946046 100644 --- a/README.md +++ b/README.md @@ -12,24 +12,24 @@ ## 脚本列表 -> 详细的脚本介绍、使用说明、截图,请点击第三列的 **「安装」** 前往 GreasyFork 查看。 +> 详细的脚本介绍、使用说明、截图,请点击第三列的 **安装** 前往 GreasyFork 查看。 -| 脚本名称 | 脚本功能 | 安装 | 备用 | +| 脚本名称 | 脚本功能 | 安装 / 备用 | | :---- | :---- | :----: | :----: | -| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页宽度统一... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419081)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 文件... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | -| **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 刷新不回根目录、自动显示更多文件、自动复制分享链接... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | -| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | -| **吾爱破解论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412681)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412680)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[「安装」](https://greasyfork.org/zh-CN/scripts/414005)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[「安装」](https://greasyfork.org/zh-CN/scripts/397666)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | +| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认原图... | **[安装](https://greasyfork.org/zh-CN/scripts/419081) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载 (☁)... | **[安装](https://greasyfork.org/zh-CN/scripts/412245) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子... | **[安装](https://greasyfork.org/zh-CN/scripts/412890) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件兑换/下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412362) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、自动复制分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739) / [备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | +| **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! > 所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过! @@ -40,7 +40,7 @@ 要使用该脚本,需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e) / [Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/) / [Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** -安装扩展后,点击上面第三列 **「安装」**,再点击 **\[安装脚本\]** 后扩展会弹出提示,点击 **\[安装\]** 即可。 +安装扩展后,点击上面第三列 **安装**,再点击 **\[安装脚本\]** 后扩展会弹出提示,点击 **\[安装\]** 即可。 > 其他基于 **Chromium** 内核的浏览器(如国内套皮浏览器)都可以使用 Chrome 的扩展。 From 317f7d10a38781d23c979be9d6dfffb955b0bda3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:22:14 +0800 Subject: [PATCH 0053/2377] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7fd946046..43e26e5ad 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ > 详细的脚本介绍、使用说明、截图,请点击第三列的 **安装** 前往 GreasyFork 查看。 | 脚本名称 | 脚本功能 | 安装 / 备用 | -| :---- | :---- | :----: | :----: | +| :---- | :---- | :----: | | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认原图... | **[安装](https://greasyfork.org/zh-CN/scripts/419081) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载 (☁)... | **[安装](https://greasyfork.org/zh-CN/scripts/412245) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | From 03dad1127910980da6f51379f4cc3d72c41b1eb8 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:24:23 +0800 Subject: [PATCH 0054/2377] update --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 43e26e5ad..0683eb52d 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,15 @@ | 脚本名称 | 脚本功能 | 安装 / 备用 | | :---- | :---- | :----: | -| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认原图... | **[安装](https://greasyfork.org/zh-CN/scripts/419081) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载 (☁)... | **[安装](https://greasyfork.org/zh-CN/scripts/412245) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子... | **[安装](https://greasyfork.org/zh-CN/scripts/412890) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件兑换/下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412362) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、自动复制分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739) / [备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | From 85359e056206f7faec5b9559b50a335a5cd8e2da Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:26:47 +0800 Subject: [PATCH 0055/2377] update --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 0683eb52d..49b69fd8e 100644 --- a/README.md +++ b/README.md @@ -14,22 +14,22 @@ > 详细的脚本介绍、使用说明、截图,请点击第三列的 **安装** 前往 GreasyFork 查看。 -| 脚本名称 | 脚本功能 | 安装 / 备用 | +| 脚本名称 | 脚本功能 | 安装 \| 备用 | | :---- | :---- | :----: | -| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | -| **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子... | **[安装](https://greasyfork.org/zh-CN/scripts/412890) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | -| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739) / [备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | -| **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666) / [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | +| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子... | **[安装](https://greasyfork.org/zh-CN/scripts/412890) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739) \| [备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | +| **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! > 所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过! @@ -38,7 +38,7 @@ ## 如何安装/使用脚本? -要使用该脚本,需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e) / [Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/) / [Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** +要使用该脚本,需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e) \| [Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/) \| [Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** 安装扩展后,点击上面第三列 **安装**,再点击 **\[安装脚本\]** 后扩展会弹出提示,点击 **\[安装\]** 即可。 From bd7c0c7a45894a567fe7b48c8ac7529e530c7b77 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 5 Jan 2021 11:39:42 +0800 Subject: [PATCH 0056/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=98=BE=E7=A4=BA=E9=9A=90=E8=97=8F=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?]=20=E8=84=9A=E6=9C=AC=E8=8F=9C=E5=8D=95=E9=80=89=E9=A1=B9?= =?UTF-8?q?=EF=BC=88=E7=8E=B0=E5=9C=A8=E5=8F=AF=E4=BB=A5=E6=8C=89=E9=9C=80?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 30 +++++++++++++++++++----------- README.md | 2 +- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index cd113a256..891e37543 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.3 +// @version 1.0.4 // @author X.I.U // @description 自动无缝翻页、自动显示帖子内被隐藏的回复 // @match *://www.hostloc.com/* @@ -18,23 +18,29 @@ // ==/UserScript== (function() { - var menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'); - var menu_thread_pageLoading_ID, menu_feedBack_ID; + var menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'), + menu_showhide = GM_getValue('xiu2_menu_showhide'); + var menu_thread_pageLoading_ID, menu_showhide_ID, menu_feedBack_ID; if (menu_thread_pageLoading == null){menu_thread_pageLoading = true; GM_setValue('xiu2_menu_thread_pageLoading', menu_thread_pageLoading)}; + if (menu_showhide == null){menu_showhide = true; GM_setValue('xiu2_menu_showhide', menu_showhide)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_thread_pageLoading_; + let menu_thread_pageLoading_, menu_showhide_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_thread_pageLoading_ID); + GM_unregisterMenuCommand(menu_showhide_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'); + menu_showhide = GM_getValue('xiu2_menu_showhide'); } if (menu_thread_pageLoading){menu_thread_pageLoading_ = "√";}else{menu_thread_pageLoading_ = "×";} + if (menu_showhide){menu_showhide_ = "√";}else{menu_showhide_ = "×";} menu_thread_pageLoading_ID = GM_registerMenuCommand(`[ ${menu_thread_pageLoading_} ] 帖子内自动翻页`, function(){menu_switch(menu_thread_pageLoading,'xiu2_menu_thread_pageLoading','帖子内自动翻页')}); + menu_showhide_ID = GM_registerMenuCommand(`[ ${menu_showhide_} ] 自动显示隐藏回复`, function(){menu_switch(menu_showhide,'xiu2_menu_showhide','自动显示隐藏回复')}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -89,10 +95,10 @@ // 用于脚本内部判断当前 URL 类型 let SiteType = { - FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 + FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 THREAD: DBSite.thread.SiteTypeID, // 帖子内 - GUIDE: DBSite.guide.SiteTypeID, // 导读帖子列表 - SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 + GUIDE: DBSite.guide.SiteTypeID, // 导读帖子列表 + SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 }; // URL 匹配正则表达式 @@ -120,7 +126,7 @@ } curSite.pageUrl = ""; // 下一页URL - pageLoading(); // 自动翻页 + pageLoading(); // 自动翻页 // 自动翻页 @@ -148,9 +154,11 @@ // 自动显示帖子内被隐藏的回复 function showPosts() { - var showposts = document.querySelector('#hiddenpoststip a'); - if (showposts){ // 如果存在 - showposts.click(); + if(menu_showhide){ + var showposts = document.querySelector('#hiddenpoststip a'); + if (showposts){ // 如果存在 + showposts.click(); + } } } diff --git a/README.md b/README.md index 49b69fd8e..7a5a6c684 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ | **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子... | **[安装](https://greasyfork.org/zh-CN/scripts/412890) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | From b819d40109009d1dc6b35004890da11e82e4c69f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 9 Jan 2021 09:17:21 +0800 Subject: [PATCH 0057/2377] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20[=E4=B8=AD?= =?UTF-8?q?=E5=9B=BD=E9=A6=99=E6=B8=AF]=20=E4=B8=BA=20[=E6=97=A5=E6=9C=AC?= =?UTF-8?q?=E4=B8=9C=E4=BA=AC]=EF=BC=9B=E4=BF=AE=E5=A4=8D=20[=E9=9F=A9?= =?UTF-8?q?=E5=9B=BD=E9=A6=96=E5=B0=94]=20URL=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88=E8=99=BD=E7=84=B6=E4=B8=8D?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=E4=BD=BF=E7=94=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 7036d8e18..eb43322a2 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.0 +// @version 1.3.1 // @author X.I.U // @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -28,9 +28,9 @@ ['https://gh.con.sh','美国'], ['https://gh.api.99988866.xyz','美国'], ['https://download.fastgit.org','日本东京'], - ['https://ghproxy.com/','韩国首尔'], - ['https://pd.zwc365.com/seturl','中国香港'], - ['https://github.xiu2.xyz','中国香港'] + ['https://github.xiu2.xyz','日本东京'], + ['https://ghproxy.com','韩国首尔'], + ['https://pd.zwc365.com/seturl','中国香港'] ], clone_url = [ 'https://hub.fastgit.org', From a9de1d319a93f7eb03efbf355d5fd7296de1d108 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 10 Jan 2021 12:35:35 +0800 Subject: [PATCH 0058/2377] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 2 +- GithubEnhanced-High-Speed-Download.user.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 57ede06c2..c7aa806f1 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -10,7 +10,7 @@ // @match *://www.appinn.com/ // @match *://www.appinn.com/*/*/ // @match *://www.appinn.com/?s=* -// @icon https://github.githubassets.com/favicon.ico +// @icon https://github.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_openInTab diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index eb43322a2..13c2652cc 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -4,7 +4,7 @@ // @author X.I.U // @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* -// @icon https://github.githubassets.com/favicon.ico +// @icon https://github.com/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand From 38d40ca3d3db310fdf479e65d1a80e58ab8ea1a0 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 13 Jan 2021 15:58:52 +0800 Subject: [PATCH 0059/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E8=8F=9C=E5=8D=95=E4=BD=8D=E7=BD=AE=EF=BC=88=E4=B8=BA?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E5=BD=93=E5=89=8D=E4=BD=8D=E7=BD=AE=EF=BC=89?= =?UTF-8?q?=EF=BC=9B=E4=BC=98=E5=8C=96=20=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 68 ++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 42 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 9018c73a5..3c13eb3df 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.1.0 +// @version 1.1.1 // @author X.I.U // @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接 // @match *://*.lanzous.com/* @@ -143,53 +143,37 @@ // 右键文件显示菜单 function rightClickMenu() { if(menu_rightClickMenu){ // 脚本菜单开启时才继续 - var folder_list = mainframe.document.getElementById("sub_folder_list"); - if(folder_list){ // 文件夹列表 - folder_list.oncontextmenu = function(e){ - e.preventDefault(); // 屏蔽浏览器自身右键菜单 - let folder_list_ID = e.target.id; - //console.log(e.target.nodeName) - //console.log(e.target.className) - //console.log(e.target.id) - if(e.target.nodeName == "FONT") - { - folder_list_ID = e.target.parentNode.parentNode.id - }else if(e.target.id == ""){ - folder_list_ID = e.target.parentNode.id - } - folder_list_ID = /\d+/.exec(folder_list_ID) - if(folder_list_ID.length > 0){ - mainframe.document.getElementById("folse" + folder_list_ID[0]).focus(); - mainframe.document.getElementById("folse" + folder_list_ID[0]).click(); - } + rightClickMenu_("sub_folder_list", "fols", "folse") // 文件夹 + rightClickMenu_("filelist", "fs", "fse") // 文件 + } + } + + + // 右键文件显示菜单,参数:文件/文件夹列表 ID、菜单 ID 前缀 + function rightClickMenu_(list_id_name, menu_id_name_prefix, list_id_name_prefix) { + let list_ = mainframe.document.getElementById(list_id_name); + if(list_){ // 文件/文件夹列表 + list_.oncontextmenu = function(e){ + e.preventDefault(); // 屏蔽浏览器自身右键菜单 + let left = e.pageX - 30; // 右键菜单弹出位置 + let list_ID = e.target.id; + if(e.target.nodeName == "FONT"){ + list_ID = e.target.parentNode.parentNode.id + }else if(e.target.id == ""){ + list_ID = e.target.parentNode.id } - } - var file_list = mainframe.document.getElementById("filelist"); - if(file_list){ // 文件列表 - file_list.oncontextmenu = function(e){ - e.preventDefault(); // 屏蔽浏览器自身右键菜单 - let file_list_ID = e.target.id; - //console.log(e.target.nodeName) - //console.log(e.target.className) - //console.log(e.target.id) - if(e.target.nodeName == "FONT") - { - file_list_ID = e.target.parentNode.parentNode.id - }else if(e.target.id == ""){ - file_list_ID = e.target.parentNode.id - } - file_list_ID = /\d+/.exec(file_list_ID) - if(file_list_ID.length > 0){ - mainframe.document.getElementById("fse" + file_list_ID[0]).focus(); - mainframe.document.getElementById("fse" + file_list_ID[0]).click(); - } + list_ID = /\d+/.exec(list_ID) + if(list_ID.length > 0){ + mainframe.document.getElementById(menu_id_name_prefix + list_ID[0]).style.cssText="position: absolute !important; left: " + left + "px;" // 修改右键菜单弹出位置(X) + mainframe.document.getElementById(list_id_name_prefix + list_ID[0]).focus(); + mainframe.document.getElementById(list_id_name_prefix + list_ID[0]).click(); } } } } - // 自动显示更多文件 + // 自动显示更多文件(后台页) function fileMore() { let filemore = mainframe.document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 if(filemore && filemore.style.display == "block"){ // 判断按钮是否存在且可见 @@ -200,7 +184,7 @@ } - // 自动显示更多文件 + // 自动显示更多文件(分享链接列表页) function fileMoreS() { let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 if(filemore && filemore.style.display != "none"){ // 判断按钮是否存在且可见 From 2a1df27b4c30f3ad3ab5bba063c7bb29fc5a52da Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 13 Jan 2021 19:40:15 +0800 Subject: [PATCH 0060/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E9=93=BE=E6=8E=A5=E9=87=8D=E5=AE=9A=E5=90=91=EF=BC=88?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86=E5=9C=B0=E5=8C=BA=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=AE=BF=E9=97=AE=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 3c13eb3df..5097946b2 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,11 +1,12 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.1.1 +// @version 1.1.2 // @author X.I.U -// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接 +// @description 刷新不返回根目录、右键文件显示菜单、分享链接重定向(解决部分地区无法访问)、自动显示更多文件、自动打开分享链接、自动复制分享链接 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* +// @match *://pan.lanzou.com/* // @match *://www.lanzou.com/account.php // @match *://www.lanzou.com/u // @match *://up.woozooo.com/u @@ -29,38 +30,44 @@ var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'), menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'), menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'), - menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'); - var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_feedBack_ID; + menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'), + menu_urlRedirect = GM_getValue('xiu2_menu_urlRedirect'); + var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_urlRedirect_ID, menu_feedBack_ID; if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; if (menu_copy_fileSha == null){menu_copy_fileSha = true; GM_setValue('xiu2_menu_copy_fileSha', menu_copy_fileSha)}; if (menu_refreshCorrection == null){menu_refreshCorrection = true; GM_setValue('xiu2_menu_refreshCorrection', menu_refreshCorrection)}; if (menu_rightClickMenu == null){menu_rightClickMenu = true; GM_setValue('xiu2_menu_rightClickMenu', menu_rightClickMenu)}; + if (menu_urlRedirect == null){menu_urlRedirect = false; GM_setValue('xiu2_menu_urlRedirect', menu_urlRedirect)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_, menu_rightClickMenu_; + var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_, menu_rightClickMenu_, menu_urlRedirect_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_open_fileSha_ID); GM_unregisterMenuCommand(menu_copy_fileSha_ID); GM_unregisterMenuCommand(menu_refreshCorrection_ID); GM_unregisterMenuCommand(menu_rightClickMenu_ID); + GM_unregisterMenuCommand(menu_urlRedirect_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'); menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'); + menu_rightClickMenu = GM_getValue('xiu2_menu_urlRedirect'); } if (menu_open_fileSha){menu_open_fileSha_ = "√";}else{menu_open_fileSha_ = "×";} if (menu_copy_fileSha){menu_copy_fileSha_ = "√";}else{menu_copy_fileSha_ = "×";} if (menu_refreshCorrection){menu_refreshCorrection_ = "√";}else{menu_refreshCorrection_ = "×";} if (menu_rightClickMenu){menu_rightClickMenu_ = "√";}else{menu_rightClickMenu_ = "×";} + if (menu_urlRedirect){menu_urlRedirect_ = "√";}else{menu_urlRedirect_ = "×";} menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新不返回根目录`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新不返回根目录', false)}); menu_rightClickMenu_ID = GM_registerMenuCommand(`[ ${menu_rightClickMenu_} ] 右键文件显示菜单`, function(){menu_switch(menu_rightClickMenu,'xiu2_menu_rightClickMenu','右键文件显示菜单', true)}); + menu_urlRedirect_ID = GM_registerMenuCommand(`[ ${menu_urlRedirect_} ] 分享链接重定向(解决部分地区无法访问)`, function(){menu_switch(menu_urlRedirect,'xiu2_menu_urlRedirect','分享链接重定向', true)}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -83,6 +90,7 @@ }; + urlRedirect(); // 分享链接重定向 if(document.getElementById("infos")){ // 分享链接文件列表页 setTimeout(fileMoreS, 300); // 自动显示更多文件 }else if(document.querySelector("iframe.ifr2")){ // 分享链接文件下载页(暂时没有这方面的功能,先空着) @@ -140,6 +148,15 @@ } + // 分享链接重定向 + function urlRedirect() { + if(menu_urlRedirect){ + if(/lanzou[s|x|i]\.com/.test(window.top.location.hostname)){ + window.top.location.hostname = "pan.lanzou.com" + } + } + } + // 右键文件显示菜单 function rightClickMenu() { if(menu_rightClickMenu){ // 脚本菜单开启时才继续 From e0d92f8c31e7bd541930e260ebe211a00fe59071 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 13 Jan 2021 20:33:35 +0800 Subject: [PATCH 0061/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7a5a6c684..a319f1fc7 100644 --- a/README.md +++ b/README.md @@ -16,20 +16,20 @@ | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :---- | :---- | :----: | -| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | -| **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | -| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739) \| [备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | -| **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666) \| [备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | +| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | +| **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! > 所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过! @@ -38,7 +38,7 @@ ## 如何安装/使用脚本? -要使用该脚本,需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e) \| [Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/) \| [Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** +要使用该脚本,需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e)** \| **[Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/)** \| **[Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** 安装扩展后,点击上面第三列 **安装**,再点击 **\[安装脚本\]** 后扩展会弹出提示,点击 **\[安装\]** 即可。 From 07933b0231a0ed07c10260b7f5b486d1ddd4770f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 13 Jan 2021 21:47:53 +0800 Subject: [PATCH 0062/2377] =?UTF-8?q?=E6=92=A4=E5=9B=9E=20[=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E9=93=BE=E6=8E=A5=E9=87=8D=E5=AE=9A=E5=90=91]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 5097946b2..67f4f5d23 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 蓝奏云网盘增强 // @version 1.1.2 // @author X.I.U -// @description 刷新不返回根目录、右键文件显示菜单、分享链接重定向(解决部分地区无法访问)、自动显示更多文件、自动打开分享链接、自动复制分享链接 +// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -30,44 +30,38 @@ var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'), menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'), menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'), - menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'), - menu_urlRedirect = GM_getValue('xiu2_menu_urlRedirect'); - var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_urlRedirect_ID, menu_feedBack_ID; + menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'); + var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_feedBack_ID; if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; if (menu_copy_fileSha == null){menu_copy_fileSha = true; GM_setValue('xiu2_menu_copy_fileSha', menu_copy_fileSha)}; if (menu_refreshCorrection == null){menu_refreshCorrection = true; GM_setValue('xiu2_menu_refreshCorrection', menu_refreshCorrection)}; if (menu_rightClickMenu == null){menu_rightClickMenu = true; GM_setValue('xiu2_menu_rightClickMenu', menu_rightClickMenu)}; - if (menu_urlRedirect == null){menu_urlRedirect = false; GM_setValue('xiu2_menu_urlRedirect', menu_urlRedirect)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_, menu_rightClickMenu_, menu_urlRedirect_; + var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_, menu_rightClickMenu_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_open_fileSha_ID); GM_unregisterMenuCommand(menu_copy_fileSha_ID); GM_unregisterMenuCommand(menu_refreshCorrection_ID); GM_unregisterMenuCommand(menu_rightClickMenu_ID); - GM_unregisterMenuCommand(menu_urlRedirect_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'); menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'); - menu_rightClickMenu = GM_getValue('xiu2_menu_urlRedirect'); } if (menu_open_fileSha){menu_open_fileSha_ = "√";}else{menu_open_fileSha_ = "×";} if (menu_copy_fileSha){menu_copy_fileSha_ = "√";}else{menu_copy_fileSha_ = "×";} if (menu_refreshCorrection){menu_refreshCorrection_ = "√";}else{menu_refreshCorrection_ = "×";} if (menu_rightClickMenu){menu_rightClickMenu_ = "√";}else{menu_rightClickMenu_ = "×";} - if (menu_urlRedirect){menu_urlRedirect_ = "√";}else{menu_urlRedirect_ = "×";} menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新不返回根目录`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新不返回根目录', false)}); menu_rightClickMenu_ID = GM_registerMenuCommand(`[ ${menu_rightClickMenu_} ] 右键文件显示菜单`, function(){menu_switch(menu_rightClickMenu,'xiu2_menu_rightClickMenu','右键文件显示菜单', true)}); - menu_urlRedirect_ID = GM_registerMenuCommand(`[ ${menu_urlRedirect_} ] 分享链接重定向(解决部分地区无法访问)`, function(){menu_switch(menu_urlRedirect,'xiu2_menu_urlRedirect','分享链接重定向', true)}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -90,7 +84,6 @@ }; - urlRedirect(); // 分享链接重定向 if(document.getElementById("infos")){ // 分享链接文件列表页 setTimeout(fileMoreS, 300); // 自动显示更多文件 }else if(document.querySelector("iframe.ifr2")){ // 分享链接文件下载页(暂时没有这方面的功能,先空着) @@ -148,15 +141,6 @@ } - // 分享链接重定向 - function urlRedirect() { - if(menu_urlRedirect){ - if(/lanzou[s|x|i]\.com/.test(window.top.location.hostname)){ - window.top.location.hostname = "pan.lanzou.com" - } - } - } - // 右键文件显示菜单 function rightClickMenu() { if(menu_rightClickMenu){ // 脚本菜单开启时才继续 From 477edccc76f442d80975dd7cf21acb82f05e39a1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 14 Jan 2021 12:38:22 +0800 Subject: [PATCH 0063/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=BF=BB?= =?UTF-8?q?=E9=A1=B5=E7=81=B5=E6=95=8F=E5=BA=A6=EF=BC=88=E9=98=88=E5=80=BC?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index c7aa806f1..047b9cdbc 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.1 +// @version 1.1.2 // @author X.I.U // @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化)、小众软件 // @match *://www.423down.com/* @@ -35,7 +35,7 @@ pageElement: 'css;div.content-wrap ul.excerpt > li', HT_insert: ['css;div.content-wrap ul.excerpt', 2], replaceE: 'css;div.paging', - scrollDelta: 1300 + scrollDelta: 1500 } }, postslist_apphot: { @@ -55,7 +55,7 @@ pageElement: 'css;section#latest-posts > article', HT_insert: ['css;nav.navigation.pagination', 1], replaceE: 'css;div.nav-links', - scrollDelta: 1300 + scrollDelta: 1500 } } }; @@ -88,6 +88,7 @@ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + console.log(document.documentElement.scrollHeight) let scrollDelta = curSite.pager.scrollDelta; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { ShowPager.loadMorePage(); From 103084434b40b03eaf773c18971b1e316c78c766 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 17 Jan 2021 16:11:45 +0800 Subject: [PATCH 0064/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=E6=97=B6=E9=97=B4]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 9e13d75c2..29021bf09 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.1 +// @version 1.2.2 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认站外直链 +// @description 移除登录弹窗、一键收起回答、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/static/favicon.ico @@ -107,6 +107,18 @@ function topTime_index() }) } + +// UTC 标准时转 UTC+8 北京时间,来自:https://greasyfork.org/zh-CN/scripts/402808 +function getUTC8 (datetime) { + let month = (datetime.getMonth() + 1) < 10 ? "0" + (datetime.getMonth() + 1) : (datetime.getMonth() + 1); + let date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate(); + let hours = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours(); + let minutes = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes(); + let seconds = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds(); + return (datetime.getFullYear() + "-" + month + "-" + date + "\xa0\xa0" + hours + ":" + minutes + ":" + seconds); +} + + // 置顶显示时间 - 回答页,来自:https://greasyfork.org/scripts/402808 function topTime_question() { @@ -147,6 +159,17 @@ function topTime_question() }) $(".Pc-card.Card").attr("style","display:none") + + //问题创建时间,来自:https://greasyfork.org/zh-CN/scripts/402808 + if ($(".QuestionPage .QuestionHeader-side p").length == 0 && window.location.href.indexOf("log") == -1) //非问题日志页 + { + let createtime = $(".QuestionPage>[itemprop~=dateCreated]").attr("content"); + let modifiedtime = $(".QuestionPage>[itemprop~=dateModified]").attr("content"); + createtime = getUTC8(new Date(createtime)); + modifiedtime = getUTC8(new Date(modifiedtime)); + + $(".QuestionPage .QuestionHeader-side").append('

创建时间:  ' + createtime + '

最后编辑:  ' + modifiedtime + '

'); + } } // 置顶显示时间 - 专栏/文章,来自:https://greasyfork.org/scripts/402808 @@ -397,21 +420,21 @@ function removeLogin() { function EventXMLHttpRequest() { var _send = window.XMLHttpRequest.prototype.send function sendReplacement(data) { - console.log(`111111`); + //console.log(`111111`); addTypeTips(); return _send.apply(this, arguments); } window.XMLHttpRequest.prototype.send = sendReplacement; } -(function (open) { +/*(function (open) { XMLHttpRequest.prototype.open = function () { this.addEventListener("readystatechange", function () { - console.log(this.responseURL); + //console.log(this.responseURL); }, false); open.apply(this, arguments); }; -})(XMLHttpRequest.prototype.open); +})(XMLHttpRequest.prototype.open);*/ (function() { if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 From e43772880b72cc53a379b9425b323a4f0cf024f2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 21 Jan 2021 00:23:54 +0800 Subject: [PATCH 0065/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E4=B8=AD?= =?UTF-8?q?=E5=9B=BD=E5=9B=BD=E5=86=85]=20Raw=20=E5=8A=A0=E9=80=9F?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 13c2652cc..f164d070f 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.1 +// @version 1.3.2 // @author X.I.U // @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -39,6 +39,7 @@ ], raw_url = [ ['https://raw.githubusercontent.com','Github 原生',''], + ['https://raw.sevencdn.com','中国国内',''], ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。 '], ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '] ], @@ -201,12 +202,14 @@ var href = location.href.replace('https://github.com',''), href2 = href.replace('/blob/','/'), url = [ - raw_url[1][0] + "/gh" + href.replace('/blob/','@'), - raw_url[2][0] + href2 + raw_url[1][0] + href2, + raw_url[2][0] + "/gh" + href.replace('/blob/','@'), + raw_url[3][0] + href2 ], html = ` ${raw_url[1][1]} ${raw_url[2][1]} +${raw_url[3][1]} `; $(this).after(html); }); @@ -255,15 +258,20 @@ url_tip = raw_url[0][2]; break; case 1: - url = raw_url[1][0] + '/gh' + href.replace('/blob/','@'); + url = raw_url[1][0] + href2; url_name = raw_url[1][1]; url_tip = raw_url[1][2]; break; case 2: - url = raw_url[2][0] + href2; + url = raw_url[2][0] + '/gh' + href.replace('/blob/','@'); url_name = raw_url[2][1]; url_tip = raw_url[2][2]; break; + case 3: + url = raw_url[3][0] + href2; + url_name = raw_url[3][1]; + url_tip = raw_url[3][2]; + break; } var html = ` `; $(cntElm_svg).after(html); From cdcc321e470ec6d3716c65ba29e4d68dfb312bc1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 21 Jan 2021 00:39:50 +0800 Subject: [PATCH 0066/2377] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a319f1fc7..fe580d74e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![GitHub Star](https://img.shields.io/github/stars/XIU2/UserScript.svg?style=flat-square&label=Star&color=4285dd)](https://github.com/XIU2/UserScript/stargazers) [![GitHub Fork](https://img.shields.io/github/forks/XIU2/UserScript.svg?style=flat-square&label=Fork&color=4285dd)](https://github.com/XIU2/UserScript/network/members) -🔨 自用的一些乱七八糟油猴脚本,**有什么需求、建议、问题直接提 [Issues](https://github.com/XIU2/UserScript/issues/new/choose)**,觉得**好用请点个⭐鼓励一下下~** +🔨 自用的一些乱七八糟油猴脚本,**有什么需求、建议、问题直接提 [Issues](https://github.com/XIU2/UserScript/issues/new/choose)**,觉得**好用请点个⭐鼓励一下下~** > 如果你只有 GreasyFork 账号,也可以前往 GreasyFork 脚本页面向我反馈! From e37881bab95a41297c461acf9d99fbee782c8c53 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 24 Jan 2021 14:16:43 +0800 Subject: [PATCH 0067/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E8=AF=9D=E8=AF=B4=E7=BC=96=E8=BE=91=E6=A1=86=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=A4=A7=E5=B0=8F]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 67f4f5d23..a7c77fb1c 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.1.2 +// @version 1.1.3 // @author X.I.U -// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接 +// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整话说编辑框初始大小 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -105,6 +105,7 @@ if(menu_refreshCorrection){ refreshCorrection(); // 刷新不返回根目录(F5) } + setTimeout(folderDescdes, 200); // 调整话说编辑框初始大小 EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] } } @@ -194,6 +195,15 @@ } + // 调整话说编辑框初始大小 + function folderDescdes() { + let folderdescdes = mainframe.document.getElementById("folder_descdes"); // 寻找话说(描述)编辑框 + if(folderdescdes){ // 判断话说(描述)元素是否存在 + folderdescdes.style.cssText="margin: 15px 0px; width: 666px; height: 150px;" + } + } + + // 分享链接相关(点击文件时) function fileSha() { var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框 From 99b6b2a986d8806a00d8f9b2cd84416398eddecc Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 26 Jan 2021 17:18:38 +0800 Subject: [PATCH 0068/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=8F=8F=E8=BF=B0=EF=BC=88=E8=AF=9D=E8=AF=B4=EF=BC=89?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=86=E5=88=9D=E5=A7=8B=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?]=20=E5=AF=B9=E6=96=B0=E5=BB=BA=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E3=80=81=E6=96=87=E4=BB=B6=E6=B7=BB=E5=8A=A0=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index a7c77fb1c..9a9f2c5ce 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.1.3 +// @version 1.1.4 // @author X.I.U -// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整话说编辑框初始大小 +// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -201,6 +201,14 @@ if(folderdescdes){ // 判断话说(描述)元素是否存在 folderdescdes.style.cssText="margin: 15px 0px; width: 666px; height: 150px;" } + let folderdescdes2 = mainframe.document.getElementById("fol_credes"); // 寻找话说(描述)编辑框 + if(folderdescdes2){ // 判断话说(描述)元素是否存在 + folderdescdes2.style.cssText="margin: 15px 0px; width: 666px; height: 150px;" + } + let folderdescdes3 = mainframe.document.getElementById("file_desc"); // 寻找话说(描述)编辑框 + if(folderdescdes3){ // 判断话说(描述)元素是否存在 + folderdescdes3.style.cssText="margin: 15px 0px; width: 666px; height: 150px;" + } } From a30cf6c55fe91c59641e6bd7dc9600e54b9224d2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 30 Jan 2021 10:21:56 +0800 Subject: [PATCH 0069/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Github=20?= =?UTF-8?q?=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F=E4=B8=8B=20Release=20?= =?UTF-8?q?=E9=AB=98=E9=80=9F=E4=B8=8B=E8=BD=BD=E6=8C=89=E9=92=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index f164d070f..1fe0ba7c8 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.2 +// @version 1.3.3 // @author X.I.U // @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -21,8 +21,8 @@ var backColor = '#ffffff'; var fontColor = '#888888'; if('dark' == $('html').attr('data-color-mode')){ // 黑暗模式判断 - backColor = '#0D1117'; - fontColor = '#58A6FF'; + backColor = '#272727'; + fontColor = '#dedede'; } var download_url = [ ['https://gh.con.sh','美国'], From f828c31d4e496b40a8bfef51774196b65f78b040 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 30 Jan 2021 10:38:01 +0800 Subject: [PATCH 0070/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Github=20?= =?UTF-8?q?=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F=E4=B8=8B=20Release=20?= =?UTF-8?q?=E9=AB=98=E9=80=9F=E4=B8=8B=E8=BD=BD=E6=8C=89=E9=92=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 1fe0ba7c8..d8551e06c 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -21,8 +21,8 @@ var backColor = '#ffffff'; var fontColor = '#888888'; if('dark' == $('html').attr('data-color-mode')){ // 黑暗模式判断 - backColor = '#272727'; - fontColor = '#dedede'; + backColor = '#0D1117'; + fontColor = '#b2b8bf'; } var download_url = [ ['https://gh.con.sh','美国'], From ff27011a2a0f6f49adb4c8908c15e51fb35adc1e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 1 Feb 2021 14:50:00 +0800 Subject: [PATCH 0071/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=8B=96?= =?UTF-8?q?=E5=85=A5=E6=96=87=E4=BB=B6=E8=87=AA=E5=8A=A8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=A1=86]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 9a9f2c5ce..ece15978d 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.1.4 +// @version 1.1.5 // @author X.I.U -// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整描述(话说)编辑框初始大小 +// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整描述(话说)编辑框初始大小、拖入文件自动显示上传框 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -21,6 +21,7 @@ // @grant GM_getValue // @grant GM_setValue // @grant GM_notification +// @grant unsafeWindow // @noframes // @license GPL-3.0 License // @run-at document-end @@ -107,6 +108,8 @@ } setTimeout(folderDescdes, 200); // 调整话说编辑框初始大小 EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] + + dragEnter(); // 拖入文件自动显示上传框 } } @@ -212,6 +215,20 @@ } + // 拖入文件自动显示上传框 + function dragEnter() { + mainframe.addEventListener("dragenter", function (e) { + e.preventDefault(); + e.stopPropagation(); + let f_upb = mainframe.document.querySelector(".f_upb") + if(f_upb.style.top != "-36px") { + f_upb.style.top = "-36px"; + mainframe.f_upc(); + } + }, false); + } + + // 分享链接相关(点击文件时) function fileSha() { var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框 From 348684e6f172469f8607ea3b2d47d852cc47ed8d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 5 Feb 2021 10:46:55 +0800 Subject: [PATCH 0072/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=93=9D?= =?UTF-8?q?=E5=A5=8F=E4=BA=91=E5=90=8E=E5=8F=B0=E5=9C=B0=E5=9D=80=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index ece15978d..8ef8c81c8 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,13 +1,13 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.1.5 +// @version 1.1.6 // @author X.I.U // @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整描述(话说)编辑框初始大小、拖入文件自动显示上传框 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* // @match *://pan.lanzou.com/* -// @match *://www.lanzou.com/account.php +// @match *://www.lanzou.com/account.php* // @match *://www.lanzou.com/u // @match *://up.woozooo.com/u // @match *://up.woozooo.com/mydisk.php* From b92b78d6679116b161cde492952e9b4b1daa435d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 7 Feb 2021 12:15:51 +0800 Subject: [PATCH 0073/2377] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=20[=E6=94=B6=E5=90=ACTA]=20=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Beautification.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index b93ceb36f..11d97ed8f 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛美化 -// @version 1.0.3 +// @version 1.0.4 // @author X.I.U // @description 精简多余内容 // @match *://www.52pojie.cn/* @@ -54,7 +54,7 @@ var style, style_1 = `.bml {display:none !important;}`, style_2 = ` -a[href="connect.php?mod=config"], #toptb, #navmenu, #nv_ph, #nv, #pt .y, #chart, #ft, #custominfo_pmenu, .bm.lk, .dnch_eo_pt, .dnch_eo_pr, .dnch_eo_f, ul.xl.xl2.o.cl, dl.pil.cl, td.plc.plm .sign, .dnch_eo_pb, .dnch_eo_pt, .pls .side-star, .pls .side-group, .res-footer-note, .comiis_nav, .scbar_hot_td, .md_ctrl, .pls.favatar .xg1 { +a[href="connect.php?mod=config"], #toptb, #navmenu, #nv_ph, #nv, #pt .y, #chart, #ft, #custominfo_pmenu, .bm.lk, .dnch_eo_pt, .dnch_eo_pr, .dnch_eo_f, dl.pil.cl, td.plc.plm .sign, .dnch_eo_pb, .dnch_eo_pt, .pls .side-star, .pls .side-group, .res-footer-note, .comiis_nav, .scbar_hot_td, .md_ctrl, .pls.favatar .xg1 { display:none !important; } From d1209f1e5d56c08fd8cfd521c51037acf23ed374 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 8 Feb 2021 08:43:27 +0800 Subject: [PATCH 0074/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=AD=BE?= =?UTF-8?q?=E5=88=B0=E5=90=8E=E8=BF=94=E5=9B=9E=E7=9A=84=E7=AD=89=E5=BE=85?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 3fca8c29a..b3d73d5de 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.1.8 +// @version 1.1.9 // @author X.I.U // @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* @@ -195,7 +195,7 @@ function qianDaoBack() { var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a'); if (qiandaoback){ - setTimeout(function(){qiandaoback.click()}, 500); + setTimeout(function(){qiandaoback.click()}, 100); } } From 46c0c86bcd58c61d4e8d7bbc0784e3ac6b843ecc Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 13 Feb 2021 11:28:53 +0800 Subject: [PATCH 0075/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=9F=A9?= =?UTF-8?q?=E5=9B=BD=E9=A6=96=E5=B0=94]=20Raw=20=E5=8A=A0=E9=80=9F?= =?UTF-8?q?=E6=BA=90=EF=BC=9B=E4=BC=98=E5=8C=96=20Raw=20=E5=8A=A0=E9=80=9F?= =?UTF-8?q?=E6=BA=90=E5=90=8D=E7=A7=B0=EF=BC=88=E5=8C=BA=E5=88=86=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E5=9B=BD=E5=86=85=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 36 ++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index d8551e06c..85f4c44d1 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.3 +// @version 1.3.4 // @author X.I.U // @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -39,9 +39,10 @@ ], raw_url = [ ['https://raw.githubusercontent.com','Github 原生',''], - ['https://raw.sevencdn.com','中国国内',''], - ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。 '], - ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '] + ['https://raw.sevencdn.com','中国国内 01',''], + ['https://cdn.jsdelivr.net','中国国内 02','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。 '], + ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '], + ['https://ghproxy.com','韩国首尔',''] ], svg = [ '', @@ -204,12 +205,14 @@ url = [ raw_url[1][0] + href2, raw_url[2][0] + "/gh" + href.replace('/blob/','@'), - raw_url[3][0] + href2 + raw_url[3][0] + href2, + raw_url[4][0] + "/" + raw_url[0][0] + href2 ], html = ` ${raw_url[1][1]} ${raw_url[2][1]} ${raw_url[3][1]} +${raw_url[4][1]} `; $(this).after(html); }); @@ -252,25 +255,20 @@ var href2 = href.replace('/blob/','/'), url, url_name, url_tip = ''; switch(menu_raw_fast) { - case 0: - url = raw_url[0][0] + href2; - url_name = raw_url[0][1]; - url_tip = raw_url[0][2]; - break; - case 1: - url = raw_url[1][0] + href2; - url_name = raw_url[1][1]; - url_tip = raw_url[1][2]; - break; case 2: url = raw_url[2][0] + '/gh' + href.replace('/blob/','@'); url_name = raw_url[2][1]; url_tip = raw_url[2][2]; break; - case 3: - url = raw_url[3][0] + href2; - url_name = raw_url[3][1]; - url_tip = raw_url[3][2]; + case 4: + url = raw_url[4][0] + "/" + raw_url[0][0] + href2; + url_name = raw_url[4][1]; + url_tip = raw_url[4][2]; + break; + default: + url = raw_url[menu_raw_fast][0] + href2; + url_name = raw_url[menu_raw_fast][1]; + url_tip = raw_url[menu_raw_fast][2]; break; } var html = ` `; From 100d477e26874375adc1c490e65bc552d9a25d6c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 13 Feb 2021 12:38:25 +0800 Subject: [PATCH 0076/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=8F=8F=E8=BF=B0=EF=BC=88=E8=AF=9D=E8=AF=B4=EF=BC=89?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=86=E5=A4=A7=E5=B0=8F]=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=8F=9C=E5=8D=95;=E4=BC=98=E5=8C=96=20[=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=8F=8F=E8=BF=B0=EF=BC=88=E8=AF=9D=E8=AF=B4=EF=BC=89?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=86=E5=A4=A7=E5=B0=8F]=EF=BC=88?= =?UTF-8?q?=E8=B0=83=E5=B0=8F=E4=BA=86=E4=B8=80=E7=82=B9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 8ef8c81c8..32602a049 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.1.6 +// @version 1.1.7 // @author X.I.U // @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整描述(话说)编辑框初始大小、拖入文件自动显示上传框 // @match *://*.lanzous.com/* @@ -31,38 +31,44 @@ var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'), menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'), menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'), - menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'); - var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_feedBack_ID; + menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'), + menu_folderDescdesMenu = GM_getValue('xiu2_menu_folderDescdesMenu'); + var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_folderDescdesMenu_ID, menu_feedBack_ID; if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; if (menu_copy_fileSha == null){menu_copy_fileSha = true; GM_setValue('xiu2_menu_copy_fileSha', menu_copy_fileSha)}; if (menu_refreshCorrection == null){menu_refreshCorrection = true; GM_setValue('xiu2_menu_refreshCorrection', menu_refreshCorrection)}; if (menu_rightClickMenu == null){menu_rightClickMenu = true; GM_setValue('xiu2_menu_rightClickMenu', menu_rightClickMenu)}; + if (menu_folderDescdesMenu == null){menu_folderDescdesMenu = true; GM_setValue('xiu2_menu_folderDescdesMenu', menu_folderDescdesMenu)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_, menu_rightClickMenu_; + var menu_open_fileSha_, menu_copy_fileSha_, menu_refreshCorrection_, menu_rightClickMenu_, menu_folderDescdesMenu_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_open_fileSha_ID); GM_unregisterMenuCommand(menu_copy_fileSha_ID); GM_unregisterMenuCommand(menu_refreshCorrection_ID); GM_unregisterMenuCommand(menu_rightClickMenu_ID); + GM_unregisterMenuCommand(menu_folderDescdesMenu_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'); menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'); menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'); menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'); + menu_folderDescdesMenu = GM_getValue('xiu2_menu_folderDescdesMenu'); } if (menu_open_fileSha){menu_open_fileSha_ = "√";}else{menu_open_fileSha_ = "×";} if (menu_copy_fileSha){menu_copy_fileSha_ = "√";}else{menu_copy_fileSha_ = "×";} if (menu_refreshCorrection){menu_refreshCorrection_ = "√";}else{menu_refreshCorrection_ = "×";} if (menu_rightClickMenu){menu_rightClickMenu_ = "√";}else{menu_rightClickMenu_ = "×";} + if (menu_folderDescdesMenu){menu_folderDescdesMenu_ = "√";}else{menu_folderDescdesMenu_ = "×";} menu_open_fileSha_ID = GM_registerMenuCommand(`[ ${menu_open_fileSha_} ] 自动打开分享链接`, function(){menu_switch(menu_open_fileSha,'xiu2_menu_open_fileSha','自动打开分享链接', true)}); menu_copy_fileSha_ID = GM_registerMenuCommand(`[ ${menu_copy_fileSha_} ] 自动复制分享链接`, function(){menu_switch(menu_copy_fileSha,'xiu2_menu_copy_fileSha','自动复制分享链接', true)}); menu_refreshCorrection_ID = GM_registerMenuCommand(`[ ${menu_refreshCorrection_} ] 刷新不返回根目录`, function(){if(menu_refreshCorrection){UNrefreshCorrection();}else{refreshCorrection();};menu_switch(menu_refreshCorrection,'xiu2_menu_refreshCorrection','刷新不返回根目录', false)}); menu_rightClickMenu_ID = GM_registerMenuCommand(`[ ${menu_rightClickMenu_} ] 右键文件显示菜单`, function(){menu_switch(menu_rightClickMenu,'xiu2_menu_rightClickMenu','右键文件显示菜单', true)}); + menu_folderDescdesMenu_ID = GM_registerMenuCommand(`[ ${menu_folderDescdesMenu_} ] 调整描述(话说)编辑框大小`, function(){menu_switch(menu_folderDescdesMenu,'xiu2_menu_folderDescdesMenu','调整描述(话说)编辑框大小', true)}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -200,17 +206,19 @@ // 调整话说编辑框初始大小 function folderDescdes() { - let folderdescdes = mainframe.document.getElementById("folder_descdes"); // 寻找话说(描述)编辑框 - if(folderdescdes){ // 判断话说(描述)元素是否存在 - folderdescdes.style.cssText="margin: 15px 0px; width: 666px; height: 150px;" - } - let folderdescdes2 = mainframe.document.getElementById("fol_credes"); // 寻找话说(描述)编辑框 - if(folderdescdes2){ // 判断话说(描述)元素是否存在 - folderdescdes2.style.cssText="margin: 15px 0px; width: 666px; height: 150px;" - } - let folderdescdes3 = mainframe.document.getElementById("file_desc"); // 寻找话说(描述)编辑框 - if(folderdescdes3){ // 判断话说(描述)元素是否存在 - folderdescdes3.style.cssText="margin: 15px 0px; width: 666px; height: 150px;" + if(menu_folderDescdesMenu) { + let folderdescdes = mainframe.document.getElementById("folder_descdes"); // 寻找话说(描述)编辑框 + if(folderdescdes){ // 判断话说(描述)元素是否存在 + folderdescdes.style.cssText="margin: 15px 0px; width: 550px; height: 125px;" + } + let folderdescdes2 = mainframe.document.getElementById("fol_credes"); // 寻找话说(描述)编辑框 + if(folderdescdes2){ // 判断话说(描述)元素是否存在 + folderdescdes2.style.cssText="margin: 15px 0px; width: 550px; height: 125px;" + } + let folderdescdes3 = mainframe.document.getElementById("file_desc"); // 寻找话说(描述)编辑框 + if(folderdescdes3){ // 判断话说(描述)元素是否存在 + folderdescdes3.style.cssText="margin: 15px 0px; width: 550px; height: 125px;" + } } } From 96b0e852b8119b7f4e3031d458fb42145e047435 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 16 Feb 2021 00:39:59 +0800 Subject: [PATCH 0077/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=86=85=E8=87=AA=E5=8A=A8=E7=BF=BB=E9=A1=B5=E8=87=B3?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E9=A1=B5=E6=97=B6=E9=A1=B5=E6=95=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index b3d73d5de..36ca8100e 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.1.9 +// @version 1.2.0 // @author X.I.U // @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* @@ -75,7 +75,7 @@ nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div#postlist > div[id^="post_"]', HT_insert: ['css;div#postlist', 2], - replaceE: '//div[@class="pg"] | //div[@class="pgbtn"]', + replaceE: 'css;div.pg', scrollDelta: 766 } }, @@ -132,7 +132,10 @@ // URL 判断 if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){ // 帖子内 - if(menu_thread_pageLoading)curSite = DBSite.thread; + if(menu_thread_pageLoading) { + curSite = DBSite.thread; + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + } }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ // 各板块帖子列表 curSite = DBSite.forum; @@ -195,7 +198,7 @@ function qianDaoBack() { var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a'); if (qiandaoback){ - setTimeout(function(){qiandaoback.click()}, 100); + setTimeout(function(){qiandaoback.click()}, 200); } } @@ -239,6 +242,14 @@ } + // 隐藏帖子内的 [下一页] 按钮 + function hidePgbtn(){ + let style_hidePgbtn = document.createElement('style'); + style_hidePgbtn.innerHTML = `.pgbtn {display: none;}`; + document.head.appendChild(style_hidePgbtn); + } + + // 监听 XMLHttpRequest 事件 function EventXMLHttpRequest() { var _send = window.XMLHttpRequest.prototype.send @@ -331,7 +342,9 @@ // 替换待替换元素 try { let oriE = getAllElements(curSite.pager.replaceE); + console.log(oriE) let repE = getAllElements(curSite.pager.replaceE, newBody, newBody); + console.log(repE) if (oriE.length === repE.length) { for (var i = 0; i < oriE.length; i++) { oriE[i].outerHTML = repE[i].outerHTML; From e12c1103586f0bc8a2e733e34bccba055a02e0b7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 16 Feb 2021 01:03:13 +0800 Subject: [PATCH 0078/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=86=85=E8=87=AA=E5=8A=A8=E7=BF=BB=E9=A1=B5=E8=87=B3?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E9=A1=B5=E6=97=B6=E9=A1=B5=E6=95=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 36ca8100e..f9e4d5911 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -342,9 +342,7 @@ // 替换待替换元素 try { let oriE = getAllElements(curSite.pager.replaceE); - console.log(oriE) let repE = getAllElements(curSite.pager.replaceE, newBody, newBody); - console.log(repE) if (oriE.length === repE.length) { for (var i = 0; i < oriE.length; i++) { oriE[i].outerHTML = repE[i].outerHTML; From e299e1333936334fbdee719af2606f9d5a3d8108 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 16 Feb 2021 21:33:24 +0800 Subject: [PATCH 0079/2377] Update --- 52pojie-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index f9e4d5911..e18751b45 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -251,7 +251,7 @@ // 监听 XMLHttpRequest 事件 - function EventXMLHttpRequest() { + /*function EventXMLHttpRequest() { var _send = window.XMLHttpRequest.prototype.send function sendReplacement(data) { if(this.onreadystatechange) { @@ -270,7 +270,7 @@ return this._onreadystatechange.apply(this, arguments); } window.XMLHttpRequest.prototype.send = sendReplacement; - } + }*/ // 自动无缝翻页,修改自 https://greasyfork.org/scripts/14178 function showPager() { From a9bdb588a785cf023bea2c7e1816968ec618f448 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 20 Feb 2021 13:53:44 +0800 Subject: [PATCH 0080/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20Git=20Clone=20?= =?UTF-8?q?=E5=8A=A0=E9=80=9F=E6=BA=90=E6=8F=90=E7=A4=BA=EF=BC=88=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E6=8C=87=E5=90=91=E6=97=B6=E6=98=BE=E7=A4=BA=EF=BC=89?= =?UTF-8?q?=EF=BC=9B=E4=BC=98=E5=8C=96=20=E8=84=9A=E6=9C=AC=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 111 ++++++++++----------- 1 file changed, 51 insertions(+), 60 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 85f4c44d1..a588396b2 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.4 +// @version 1.3.5 // @author X.I.U -// @description 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) +// @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @icon https://github.com/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js @@ -33,15 +33,15 @@ ['https://pd.zwc365.com/seturl','中国香港'] ], clone_url = [ - 'https://hub.fastgit.org', - 'https://gitclone.com', - 'https://github.com.cnpmjs.org' + ['https://hub.fastgit.org','中国香港'], + ['https://gitclone.com','中国浙江杭州'], + ['https://github.com.cnpmjs.org','新加坡'] ], raw_url = [ ['https://raw.githubusercontent.com','Github 原生',''], ['https://raw.sevencdn.com','中国国内 01',''], - ['https://cdn.jsdelivr.net','中国国内 02','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。 '], - ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。 '], + ['https://cdn.jsdelivr.net','中国国内 02','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。'], + ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。'], ['https://ghproxy.com','韩国首尔',''] ], svg = [ @@ -50,7 +50,6 @@ '' ], style = ['padding:0 6px;margin-right: -1px;border-radius: 2px;background-color: '+backColor+';border-color: rgba(27, 31, 35, 0.1);font-size: 11px;color: '+fontColor+';'], - menu_raw_fast = GM_getValue('xiu2_menu_raw_fast'), menu_menu_raw_fast_ID, menu_feedBack_ID; if (menu_raw_fast == null || menu_raw_fast == '中国国内'){menu_raw_fast = 1; GM_setValue('xiu2_menu_raw_fast', 1)}; // 调整上个版本的设置存储变量内容 @@ -103,7 +102,7 @@ function addRelease(){ $(".Box.Box--condensed").each(function () { $(this).find(".d-flex.Box-body>a").each(function () { - var href = $(this).attr("href"), + let href = $(this).attr("href"), url = [ download_url[0][0] + '/https://github.com' + href, download_url[1][0] + '/https://github.com' + href, @@ -112,14 +111,12 @@ download_url[4][0] + '/https://github.com' + href, download_url[5][0] + '/https://github.com' + href ], - html = ``; + html = `
`; + for (let i=0;i${download_url[i][1]}
` + } + html = html + `` $(this).next().after(html); }); // 修改[文件大小]元素样式 @@ -128,7 +125,7 @@ // Source Code $(this).find(".d-block.Box-body>a").each(function () { - var href = $(this).attr("href"), + let href = $(this).attr("href"), url = [ download_url[0][0] + '/https://github.com' + href, download_url[1][0] + '/https://github.com' + href, @@ -137,14 +134,12 @@ download_url[4][0] + '/https://github.com' + href, download_url[5][0] + '/https://github.com' + href ], - html = ``; + html = `
`; + for (let i=0;i${download_url[i][1]}
` + } + html = html + `` $(this).after(html); }); }); @@ -156,7 +151,7 @@ // Download ZIP function addDownloadZIP(){ $(".dropdown-menu.dropdown-menu-sw.p-0 ul li:last-child").each(function () { - var href = $(this).children("a").attr("href"), + let href = $(this).children("a").attr("href"), url = [ download_url[0][0] + "/https://github.com" + href, download_url[1][0] + "/https://github.com" + href, @@ -165,14 +160,11 @@ download_url[4][0] + "/https://github.com" + href, download_url[5][0] + '/https://github.com' + href ], - html = ` -
  • ${svg[0]}Download ZIP ${download_url[0][1]}
  • -
  • ${svg[0]}Download ZIP ${download_url[1][1]}
  • -
  • ${svg[0]}Download ZIP ${download_url[2][1]}
  • -
  • ${svg[0]}Download ZIP ${download_url[3][1]}
  • -
  • ${svg[0]}Download ZIP ${download_url[4][1]}
  • -
  • ${svg[0]}Download ZIP ${download_url[5][1]}
  • -`; + html = ``; + for (let i=0;i${svg[0]}Download ZIP ${download_url[i][1]}` + } $(this).after(html); }); } @@ -181,17 +173,17 @@ // Git Clone function addGitClone(){ $("[role='tabpanel'] div.input-group").first().each(function () { - var href_split = location.href.split("/"), + let href_split = location.href.split("/"), url = [ - clone_url[0] + "/" + href_split[3] + "/" + href_split[4] + ".git", - clone_url[1] + "/github.com/" + href_split[3] + "/" + href_split[4] + ".git", - clone_url[2] + "/" + href_split[3] + "/" + href_split[4] + ".git" + clone_url[0][0] + "/" + href_split[3] + "/" + href_split[4] + ".git", + clone_url[1][0] + "/github.com/" + href_split[3] + "/" + href_split[4] + ".git", + clone_url[2][0] + "/" + href_split[3] + "/" + href_split[4] + ".git" ], - html = ` -
    ${svg[1]}
    -
    ${svg[1]}
    -
    ${svg[1]}
    -`; + html = ``; + for (let i=0;i
    ${svg[1]}
    ` + } $(this).after(html); }); } @@ -200,7 +192,7 @@ // Raw function addRawFile(){ $("#raw-url").each(function () { - var href = location.href.replace('https://github.com',''), + let href = location.href.replace('https://github.com',''), href2 = href.replace('/blob/','/'), url = [ raw_url[1][0] + href2, @@ -208,12 +200,11 @@ raw_url[3][0] + href2, raw_url[4][0] + "/" + raw_url[0][0] + href2 ], - html = ` -${raw_url[1][1]} -${raw_url[2][1]} -${raw_url[3][1]} -${raw_url[4][1]} -`; + html = ``; + for (let i=0;i${raw_url[i+1][1]}` + } $(this).after(html); }); } @@ -222,14 +213,14 @@ // 添加 Raw 下载链接(☁) function addRawDownLink(){ // 如果不是项目文件页面,就返回 - var files = $('div.Box-row svg.octicon.octicon-file'); + let files = $('div.Box-row svg.octicon.octicon-file'); if(files.length === 0) return; - var files1 = $('a.fileDownLink'); + let files1 = $('a.fileDownLink'); if(files1.length > 0) return; // 鼠标指向则显示 var mouseOverHandler = function(evt){ - var elem = evt.currentTarget, + let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.text-gray-light'); aElm_new.forEach(el=>el.style.cssText = 'display: inline'); @@ -238,7 +229,7 @@ // 鼠标离开则隐藏 var mouseOutHandler = function(evt){ - var elem = evt.currentTarget, + let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.text-gray-light'); aElm_new.forEach(el=>el.style.cssText = 'display: none'); @@ -247,12 +238,12 @@ // 循环添加 files.each(function(i,fileElm){ - var trElm = fileElm.parentNode.parentNode, + let trElm = fileElm.parentNode.parentNode, cntElm_a = trElm.querySelector('.css-truncate.css-truncate-target.d-block.width-fit a'), cntElm_svg = trElm.querySelector('.mr-3.flex-shrink-0 svg.octicon.octicon-file.text-gray-light'), Name = cntElm_a.innerText, href = cntElm_a.attributes['href'].nodeValue.replace('https://github.com',''); - var href2 = href.replace('/blob/','/'), url, url_name, url_tip = ''; + let href2 = href.replace('/blob/','/'), url, url_name, url_tip = ''; switch(menu_raw_fast) { case 2: @@ -271,7 +262,7 @@ url_tip = raw_url[menu_raw_fast][2]; break; } - var html = ` `; + let html = ` `; $(cntElm_svg).after(html); // 绑定鼠标事件 trElm.onmouseover=mouseOverHandler; @@ -282,9 +273,9 @@ // 删除 Raw 快捷下载(☁) function delRawDownLink(){ - var aElm = document.querySelectorAll('.fileDownLink'); + let aElm = document.querySelectorAll('.fileDownLink'); if(aElm.length === 0) return; - for(var num = 0;num Date: Sun, 21 Feb 2021 10:57:00 +0800 Subject: [PATCH 0081/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E5=88=B0=E9=9A=90=E8=97=8F=E5=86=85=E5=AE=B9=E5=A4=84?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=88=E4=B8=8D=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=88=91=E7=9A=84=E7=BE=8E=E5=8C=96=E8=84=9A=E6=9C=AC=E4=B9=9F?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 8b47a42d6..5f99b5f6b 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 智友邦论坛增强 -// @version 1.1.4 +// @version 1.1.5 // @author X.I.U // @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件兑换/下载、清理帖子标题〖XXX〗【XXX】文字 // @icon http://bbs.zhiyoo.net/favicon.ico @@ -240,12 +240,12 @@ // 如果已显示隐藏内容,则定位到隐藏内容区域 // 如果没有发现已显示隐藏内容,就不定位了 if (document.getElementsByClassName("showhide").length > 0){ - // 如果使用了我的智友帮美化脚本,则定位至底部,反之定位至顶部 - if (document.getElementById("fastpostmessage").offsetParent == null){ - setTimeout(`window.scrollTo(0,99999999)`, 1000); - } + // 如果使用了我的智友帮美化脚本,则定位至底部 + /*if (document.getElementById("fastpostmessage").offsetParent == null){ + //setTimeout(`window.scrollTo(0,99999999)`, 1000); + }*/ + setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); //setTimeout(`location.hash='#footer'`, 1000); - //console.log(`${$(".showhide").scrollTop()}`); } } } From 5b4ca30e3881fe1c6d3925bf65cbb0f7d5df16f3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 21 Feb 2021 11:07:15 +0800 Subject: [PATCH 0082/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E5=88=B0=E9=9A=90=E8=97=8F=E5=86=85=E5=AE=B9=E5=A4=84?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=88=E4=B8=8D=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=88=91=E7=9A=84=E7=BE=8E=E5=8C=96=E8=84=9A=E6=9C=AC=E4=B9=9F?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 5f99b5f6b..8c5f6cc4f 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -208,12 +208,7 @@ // 存在隐藏内容,自动回复 if (document.getElementsByClassName("showhide").length == 0){ writeReply(); - // 如果使用了我的智友帮美化脚本,则定位至底部,反之定位至顶部 - if (document.getElementById("fastpostmessage").offsetParent == null){ - setTimeout(`window.scrollTo(0,99999999)`, 1000); - }else{ - setTimeout(`window.scrollTo(0,0)`, 1000); - } + setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 1000); } } } @@ -240,12 +235,7 @@ // 如果已显示隐藏内容,则定位到隐藏内容区域 // 如果没有发现已显示隐藏内容,就不定位了 if (document.getElementsByClassName("showhide").length > 0){ - // 如果使用了我的智友帮美化脚本,则定位至底部 - /*if (document.getElementById("fastpostmessage").offsetParent == null){ - //setTimeout(`window.scrollTo(0,99999999)`, 1000); - }*/ setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); - //setTimeout(`location.hash='#footer'`, 1000); } } } From d90fcf94313b1ed11b36d6fcab58b9e4725508ca Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 21 Feb 2021 11:52:29 +0800 Subject: [PATCH 0083/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=9B=9E=E5=A4=8D=E5=90=8E=E6=BB=9A=E5=8A=A8=E8=87=B3?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=86=85=E5=AE=B9=EF=BC=88=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=BC=80=E5=90=AF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 47 ++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 65fffd4e0..6d6c94403 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 3DM论坛增强 -// @version 1.0.5 +// @version 1.0.6 // @author X.I.U -// @description 自动回复、自动无缝翻页、清理置顶帖子 +// @description 自动回复、自动无缝翻页、清理置顶帖子 // @match *://bbs.3dmgame.com/* // @icon https://bbs.3dmgame.com/favicon.ico // @grant GM_xmlhttpRequest @@ -20,33 +20,39 @@ (function() { var menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'), menu_autoReply = GM_getValue('xiu2_menu_autoReply'), - menu_cleanTopPost = GM_getValue('xiu2_menu_cleanTopPost'); - var menu_thread_pageLoading_ID, menu_autoReply_ID, menu_cleanTopPost_ID, menu_feedBack_ID; + menu_cleanTopPost = GM_getValue('xiu2_menu_cleanTopPost'), + menu_scrollToShowhide = GM_getValue('xiu2_menu_scrollToShowhide'); + var menu_thread_pageLoading_ID, menu_autoReply_ID, menu_cleanTopPost_ID, menu_scrollToShowhide_ID, menu_feedBack_ID; if (menu_thread_pageLoading == null){menu_thread_pageLoading = false; GM_setValue('xiu2_menu_thread_pageLoading', menu_thread_pageLoading)}; if (menu_autoReply == null){menu_autoReply = true; GM_setValue('xiu2_menu_autoReply', menu_autoReply)}; if (menu_cleanTopPost == null){menu_cleanTopPost = true; GM_setValue('xiu2_menu_cleanTopPost', menu_cleanTopPost)}; + if (menu_scrollToShowhide == null){menu_scrollToShowhide = true; GM_setValue('xiu2_menu_scrollToShowhide', menu_scrollToShowhide)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_thread_pageLoading_, menu_autoReply_, menu_cleanTopPost_; + let menu_thread_pageLoading_, menu_autoReply_, menu_cleanTopPost_, menu_scrollToShowhide_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_thread_pageLoading_ID); GM_unregisterMenuCommand(menu_autoReply_ID); GM_unregisterMenuCommand(menu_cleanTopPost_ID); + GM_unregisterMenuCommand(menu_scrollToShowhide_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'); menu_autoReply = GM_getValue('xiu2_menu_autoReply'); menu_cleanTopPost = GM_getValue('xiu2_menu_cleanTopPost'); + menu_scrollToShowhide = GM_getValue('xiu2_menu_scrollToShowhide'); } if (menu_thread_pageLoading){menu_thread_pageLoading_ = "√";}else{menu_thread_pageLoading_ = "×";} if (menu_autoReply){menu_autoReply_ = "√";}else{menu_autoReply_ = "×";} if (menu_cleanTopPost){menu_cleanTopPost_ = "√";}else{menu_cleanTopPost_ = "×";} + if (menu_scrollToShowhide){menu_scrollToShowhide_ = "√";}else{menu_scrollToShowhide_ = "×";} menu_autoReply_ID = GM_registerMenuCommand(`[ ${menu_autoReply_} ] 自动回复`, function(){menu_switch(menu_autoReply,'xiu2_menu_autoReply','自动回复')}); menu_cleanTopPost_ID = GM_registerMenuCommand(`[ ${menu_cleanTopPost_} ] 清理置顶帖子`, function(){menu_switch(menu_cleanTopPost,'xiu2_menu_cleanTopPost','清理置顶帖子')}); menu_thread_pageLoading_ID = GM_registerMenuCommand(`[ ${menu_thread_pageLoading_} ] 帖子内自动翻页`, function(){menu_switch(menu_thread_pageLoading,'xiu2_menu_thread_pageLoading','帖子内自动翻页')}); + menu_scrollToShowhide_ID = GM_registerMenuCommand(`[ ${menu_scrollToShowhide_} ] 自动滚动至隐藏内容`, function(){menu_switch(menu_scrollToShowhide,'xiu2_menu_scrollToShowhide','自动滚动至隐藏内容')}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -127,7 +133,7 @@ curSite.pageUrl = ""; // URL 匹配正则表达式 - var patt_thread = /\/thread-\d+-\d+\-\d+.html/, + let patt_thread = /\/thread-\d+-\d+\-\d+.html/, patt_thread_2 = /mod\=viewthread/, patt_forum = /\/forum-\d+-\d+\.html/, patt_forum_2 = /mod\=forumdisplay/, @@ -141,6 +147,7 @@ if(menu_thread_pageLoading)curSite = DBSite.thread; if(menu_autoReply)autoReply(); // 如果有隐藏内容,则自动回复 pageLoading(); // 自动翻页 + if(menu_scrollToShowhide)setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); // 滚动至隐藏内容 }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ // 各板块帖子列表 curSite = DBSite.forum; @@ -155,9 +162,9 @@ // 判断是否登陆 function checkLogin(){ - var checklogin = document.querySelectorAll('.wp.h_menu p a'); + let checklogin = document.querySelectorAll('.wp.h_menu p a'); if (checklogin){ - for (var value of checklogin) { + for (let value of checklogin) { if (value.innerHTML == "退出"){ loginStatus = true; } @@ -171,11 +178,11 @@ if (curSite.SiteTypeID > 0){ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 - var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; let scrollDelta = 666; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { if (curSite.SiteTypeID === SiteType.FORUM) { // 如果是各版块帖子列表则直接点下一页就行了 - var autopbn = document.querySelector('#autopbn'); + let autopbn = document.querySelector('#autopbn'); if (autopbn && autopbn.innerText == "下一页 »"){ // 如果已经在加载中了,就忽略 autopbn.click(); } @@ -193,10 +200,20 @@ function autoReply(){ if (loginStatus){ // 存在隐藏内容,则自动回复 - var autoreply = document.querySelector('.locked a'); + let autoreply = document.querySelector('.locked a'); if (autoreply){ writeReply(); - setTimeout(`window.scrollTo(0,0)`, 1000); + // 滚动至隐藏内容 + if(menu_scrollToShowhide){ + let showhideTime=setInterval(function(){ + let showhide=document.querySelector('.showhide') + if(showhide){ + clearInterval(showhideTime) + window.scrollTo(0,showhide.offsetTop) + }}, 100) + }else{ + setTimeout(`window.scrollTo(0,0)`, 1000); + } } } @@ -205,10 +222,10 @@ // 写入自动回复内容 function writeReply(){ - var textarea = document.getElementById("fastpostmessage"); + let textarea = document.getElementById("fastpostmessage"); if (textarea){ textarea.value = textarea.value + replyList[Math.floor((Math.random()*replyList.length))] + replyList[Math.floor((Math.random()*replyList.length))]; - var fastpostsubmit = document.getElementById("fastpostsubmit"); + let fastpostsubmit = document.getElementById("fastpostsubmit"); if (fastpostsubmit){ fastpostsubmit.click(); } @@ -218,7 +235,7 @@ // 清理置顶帖子 function cleanTopPost(){ - var showhide = document.querySelectorAll("a.showhide.y"); + let showhide = document.querySelectorAll("a.showhide.y"); if (showhide.length > 0){ showhide.forEach(el=>el.click()); } From c12dbfbbbf039525dd9e9ae34b9551e899309cf3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Feb 2021 17:21:19 +0800 Subject: [PATCH 0084/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 84 +++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 8c5f6cc4f..0cb4ecb55 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -28,7 +28,7 @@ // 注册脚本菜单 function registerMenuCommand() { - var menu_cleanPostTitle_; + let menu_cleanPostTitle_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_cleanPostTitle_ID); GM_unregisterMenuCommand(menu_qianDaoRedirectURL_ID); @@ -115,49 +115,49 @@ // 用于脚本内部判断当前 URL 类型 let SiteType = { - FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID, // 各板块帖子列表 - SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 + FORUMDISPLAY: DBSite.forumdisplay.SiteTypeID, // 各板块帖子列表 + SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 }; var attachmentHrefTime = 0; - curSite.pageUrl = ""; // 下一页URL + curSite.pageUrl = ""; // 下一页URL - var patt_thread = /\/thread-\d+-\d+\-\d+.html/, // 匹配 /thread-XXX-X-X.html 帖子正则表达式 - patt_search = /\/thread-\d+-\d+\-\d+.html/, // 匹配搜索结果列表正则表达式 - patt_posttitle = /^〖.+〗(:)?|^【.+】(:)?/, // 匹配帖子标题中的〖XXX〗【XXX】正则表达式 + var patt_thread = /\/thread-\d+-\d+\-\d+.html/, // 匹配 /thread-XXX-X-X.html 帖子正则表达式 + patt_search = /\/thread-\d+-\d+\-\d+.html/, // 匹配搜索结果列表正则表达式 + patt_posttitle = /^〖.+〗(:)?|^【.+】(:)?/, // 匹配帖子标题中的〖XXX〗【XXX】正则表达式 patt_attachment_href = /(?<=\\').+(?=\\')/ if (location.pathname === '/plugin.php'){ switch(getQueryVariable("id")) { - case 'dsu_paulsign:sign': // 被重定向到签到页面 - qiandao(); // 自动签到 + case 'dsu_paulsign:sign': // 被重定向到签到页面 + qiandao(); // 自动签到 break; - case 'piaobo_attachment': // 兑换附件后的提示页面 - attachmentBack(); // 立即返回帖子 + case 'piaobo_attachment': // 兑换附件后的提示页面 + attachmentBack(); // 立即返回帖子 break; - case 'threed_attach:downld': // 附件下载页面 - goPan(); // 跳转至网盘页 + case 'threed_attach:downld': // 附件下载页面 + goPan(); // 跳转至网盘页 break; } }else if(location.pathname === '/forum.php'){ switch(getQueryVariable("mod")) { - case 'viewthread': // 浏览帖子内容 - showHide(); // 先看看是否有隐藏内容,如果已显示则定位到隐藏内容区域,如果没有隐藏内容,则啥都不干 - autoReply(); // 自动回复(有隐藏内容才会回复),回复过就定位到底部(隐藏内容区域) + case 'viewthread': // 浏览帖子内容 + showHide(); // 先看看是否有隐藏内容,如果已显示则定位到隐藏内容区域,如果没有隐藏内容,则啥都不干 + autoReply(); // 自动回复(有隐藏内容才会回复),回复过就定位到底部(隐藏内容区域) var attachmentHref_Interval = setInterval(attachmentHref,100); // 兑换附件按钮改为直链(不再弹出确认提示框) break; - case 'forumdisplay': // 浏览帖子列表 - curSite = DBSite.forumdisplay; // 帖子列表页(自动翻页) - cleanTop(); // 清理置顶帖子 - cleanPostTitle(); // 清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字 - pageLoading(); // 自动无缝翻页 + case 'forumdisplay': // 浏览帖子列表 + curSite = DBSite.forumdisplay; // 帖子列表页(自动翻页) + cleanTop(); // 清理置顶帖子 + cleanPostTitle(); // 清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字 + pageLoading(); // 自动无缝翻页 break; } }else if(location.pathname === '/search.php'){ - curSite = DBSite.search; // 搜索结果列表页(自动翻页) - pageLoading(); // 自动无缝翻页 + curSite = DBSite.search; // 搜索结果列表页(自动翻页) + pageLoading(); // 自动无缝翻页 }else if (patt_thread.test(location.pathname)){ // 对于 /thread-XXX-X-X.html 这种帖子页面也和上面一样 showHide(); autoReply(); @@ -166,7 +166,7 @@ // 判断是否登陆 function checkLogin(){ - var checklogin = document.querySelector('.Quater_user.logined'); + let checklogin = document.querySelector('.Quater_user.logined'); if (checklogin){ loginStatus = true; } @@ -177,8 +177,8 @@ function pageLoading() { if (curSite.SiteTypeID > 0){ windowScroll(function (direction, e) { - if (direction === "down") { // 下滑才准备翻页 - var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + if (direction === "down") { // 下滑才准备翻页 + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; let scrollDelta = 666; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { ShowPager.loadMorePage(); @@ -208,7 +208,12 @@ // 存在隐藏内容,自动回复 if (document.getElementsByClassName("showhide").length == 0){ writeReply(); - setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 1000); + // 如果使用了我的 [智友邦美化] 脚本,则定位至底部,反之定位至隐藏内容区域 + if (document.getElementById("fastpostmessage").offsetParent == null){ + setTimeout(`window.scrollTo(0,99999999)`, 500); + }else{ + setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); + } } } } @@ -216,7 +221,7 @@ // 写入自动回复内容 function writeReply(){ - var textarea = document.getElementById("fastpostmessage"); + let textarea = document.getElementById("fastpostmessage"); if (textarea){ // 随机写入回复内容 textarea.value = textarea.value + replyList[Math.floor((Math.random()*replyList.length))] + replyList[Math.floor((Math.random()*replyList.length))]; @@ -235,7 +240,14 @@ // 如果已显示隐藏内容,则定位到隐藏内容区域 // 如果没有发现已显示隐藏内容,就不定位了 if (document.getElementsByClassName("showhide").length > 0){ - setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); + // 如果使用了我的 [智友邦美化] 脚本,则定位至底部,反之定位至隐藏内容区域 + if (document.getElementById("fastpostmessage").offsetParent == null){ + setTimeout(`window.scrollTo(0,99999999)`, 500); + console.log("111") + }else{ + setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); + console.log("222") + } } } } @@ -243,7 +255,7 @@ // 兑换附件后立即返回 function attachmentBack() { - var attachmentback = document.querySelector('#messagetext p.alert_btnleft a'); + let attachmentback = document.querySelector('#messagetext p.alert_btnleft a'); if (attachmentback){ attachmentback.click(); } @@ -252,7 +264,7 @@ // 附件下载页直接跳转至网盘 function goPan() { - var gopan = document.querySelector('.threed_panbox .panframe .pan_left p a'); + let gopan = document.querySelector('.threed_panbox .panframe .pan_left p a'); if (gopan){ location.href=gopan.href; } @@ -262,9 +274,9 @@ // 兑换附件按钮改为直链(不再弹出确认提示框) function attachmentHref() { attachmentHrefTime += 1; // 计算该函数执行次数 - var attachmenthref = document.querySelector('.tab_button .button a'); + let attachmenthref = document.querySelector('.tab_button .button a'); if (attachmenthref && attachmenthref.href == "javascript:;"){ - var attachmenthref_href = attachmenthref.onclick.toString(); + let attachmenthref_href = attachmenthref.onclick.toString(); attachmenthref.href = attachmenthref_href.match(patt_attachment_href)[0]; attachmenthref.onclick = null; } @@ -276,7 +288,7 @@ // 清理置顶帖子 function cleanTop(){ - var showhide = document.querySelectorAll("a.showhide.y"); + let showhide = document.querySelectorAll("a.showhide.y"); if (showhide.length > 0){ showhide.forEach(el=>el.click()); } @@ -286,9 +298,9 @@ // 清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字 function cleanPostTitle(){ if (menu_cleanPostTitle){ - var cleanposttitle = document.querySelectorAll("a.s.xst"); + let cleanposttitle = document.querySelectorAll("a.s.xst"); if (cleanposttitle.length > 0){ - for(var num = postNum;num Date: Thu, 25 Feb 2021 12:13:05 +0800 Subject: [PATCH 0085/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=90=8E?= =?UTF-8?q?=E9=80=80=E8=BF=94=E5=9B=9E=E4=B8=8A=E4=B8=80=E7=BA=A7]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 49 +++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 32602a049..5bb7d55e1 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.1.7 +// @version 1.2.0 // @author X.I.U -// @description 刷新不返回根目录、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整描述(话说)编辑框初始大小、拖入文件自动显示上传框 +// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整描述(话说)编辑框初始大小、拖入文件自动显示上传框 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -33,7 +33,7 @@ menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'), menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'), menu_folderDescdesMenu = GM_getValue('xiu2_menu_folderDescdesMenu'); - var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_folderDescdesMenu_ID, menu_feedBack_ID; + var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_folderDescdesMenu_ID, menu_feedBack_ID, lastFolderID; if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; if (menu_copy_fileSha == null){menu_copy_fileSha = true; GM_setValue('xiu2_menu_copy_fileSha', menu_copy_fileSha)}; if (menu_refreshCorrection == null){menu_refreshCorrection = true; GM_setValue('xiu2_menu_refreshCorrection', menu_refreshCorrection)}; @@ -107,15 +107,16 @@ // 获取 iframe 框架 function iframe() { mainframe = document.getElementById("mainframe"); - if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 + if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 mainframe = mainframe.contentWindow; if(menu_refreshCorrection){ - refreshCorrection(); // 刷新不返回根目录(F5) + refreshCorrection(); // 刷新不返回根目录(F5) } setTimeout(folderDescdes, 200); // 调整话说编辑框初始大小 - EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] + fobiddenBack(); // 禁止浏览器返回(并绑定新的返回事件) + EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] - dragEnter(); // 拖入文件自动显示上传框 + dragEnter(); // 拖入文件自动显示上传框 } } @@ -289,6 +290,39 @@ } + // 禁止浏览器返回(并绑定新的返回事件) + function fobiddenBack() { + history.pushState(null, null, document.URL); + window.addEventListener('popstate',backEvent) + } + + + // 允许浏览器返回 + function enableBack() { + history.go(-1); + window.removeEventListener('popstate',backEvent) + } + + + // 浏览器后退事件函数 + function backEvent() { + if(lastFolderID) { + mainframe.folder(lastFolderID); + } + history.pushState(null, null, document.URL); + } + + + // 获取上个文件夹 ID(用于浏览器后退事件) + function getLastFolderID() { + lastFolderID = null + let f_tpspan = mainframe.document.querySelectorAll("span.f_tpspan"); + if(f_tpspan.length > 1) { + lastFolderID = /-?\d+/.exec(f_tpspan[f_tpspan.length - 2].getAttribute("onclick"))[0]; + } + } + + // 定时执行(旧方法,每隔 100ms 执行一次,比较笨且浪费一丢丢性能,但优点是不会漏掉且反应更快) //setInterval(fileMore,100); @@ -300,6 +334,7 @@ setTimeout(fileMore, 200); // 自动显示更多文件 setTimeout(fileSha, 200); // 自动打开分享链接(点击文件时) setTimeout(rightClickMenu, 500); // 右键文件显示菜单 + setTimeout(getLastFolderID, 200); // 获取上个文件夹 ID(用于浏览器后退事件) return _send.apply(this, arguments); } mainframe.XMLHttpRequest.prototype.send = sendReplacement; From 03392f86c95ef11231633d96f11847f708fae470 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 25 Feb 2021 12:36:33 +0800 Subject: [PATCH 0086/2377] README.md --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index fe580d74e..1010c1d10 100644 --- a/README.md +++ b/README.md @@ -14,22 +14,22 @@ > 详细的脚本介绍、使用说明、截图,请点击第三列的 **安装** 前往 GreasyFork 查看。 -| 脚本名称 | 脚本功能 | 安装 \| 备用 | -| :---- | :---- | :----: | -| **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| **Github 增强** | 高速下载 Clone、Release、Raw、Code(ZIP) 等文件、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | -| **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| **蓝奏云网盘 增强 \*** | 刷新不回根目录、右键显示菜单、自动显示更多文件、分享链接... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | -| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | -| **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | +| | 脚本名称 | 脚本功能 | 安装 \| 备用 | +| :----: | :---- | :---- | :----: | +| | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| | **Github 增强** | 高速下载 Git Clone、Release、Raw、Code(ZIP) 、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、右键显示菜单、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | +| | **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| | **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! > 所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过! From bc4358e2e25d78a82a4ca86a24adc035623a8244 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 25 Feb 2021 12:43:31 +0800 Subject: [PATCH 0087/2377] README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1010c1d10..c298520a5 100644 --- a/README.md +++ b/README.md @@ -16,19 +16,19 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| | **Github 增强** | 高速下载 Git Clone、Release、Raw、Code(ZIP) 、快捷下载... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| | **Github 增强** | 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、右键显示菜单、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | | **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | | **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! From 7177cb8a7f5f0edb54589d7a3111f50c807bf00d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 25 Feb 2021 12:55:10 +0800 Subject: [PATCH 0088/2377] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- Zhihu-Beautification.user.js | 2 +- Zhihu-Enhanced.user.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c298520a5..5f6722dc7 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,10 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | | **Github 增强** | 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 6d38a9635..39e938208 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -5,7 +5,7 @@ // @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* -// @icon https://static.zhihu.com/static/favicon.ico +// @icon https://static.zhihu.com/heifetz/favicon.ico // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 29021bf09..c01f57d0e 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -5,7 +5,7 @@ // @description 移除登录弹窗、一键收起回答、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* -// @icon https://static.zhihu.com/static/favicon.ico +// @icon https://static.zhihu.com/heifetz/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand From a11123cc86ab040ab0cf5d9d7cbd9fac82412b81 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 25 Feb 2021 12:56:57 +0800 Subject: [PATCH 0089/2377] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Autopage.user.js b/Autopage.user.js index 047b9cdbc..f8b1be387 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -10,7 +10,7 @@ // @match *://www.appinn.com/ // @match *://www.appinn.com/*/*/ // @match *://www.appinn.com/?s=* -// @icon https://github.com/favicon.ico +// @icon https://s3.ax1x.com/2021/02/25/yj2s4f.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_openInTab From 77a68983fd1fcaacf636919c0c2c83860b16bd26 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 25 Feb 2021 13:05:03 +0800 Subject: [PATCH 0090/2377] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Beautification.user.js | 2 +- 3dm-Enhanced.user.js | 2 +- README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3dm-Beautification.user.js b/3dm-Beautification.user.js index 59d0b84ce..f7a1f857b 100644 --- a/3dm-Beautification.user.js +++ b/3dm-Beautification.user.js @@ -3,7 +3,7 @@ // @version 1.0.0 // @author X.I.U // @description 精简多余内容 -// @icon https://bbs.3dmgame.com/favicon.ico +// @icon https://www.3dmgame.com/favicon.ico // @match *://bbs.3dmgame.com/* // @license GPL-3.0 License // @run-at document-start diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 6d6c94403..c4567c873 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -4,7 +4,7 @@ // @author X.I.U // @description 自动回复、自动无缝翻页、清理置顶帖子 // @match *://bbs.3dmgame.com/* -// @icon https://bbs.3dmgame.com/favicon.ico +// @icon https://www.3dmgame.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand diff --git a/README.md b/README.md index 5f6722dc7..4909fb4f2 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ | | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | | **Github 增强** | 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | -| | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、右键显示菜单、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | From c36a59d629afee60cd47e850367e3acec4622679 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 26 Feb 2021 11:59:47 +0800 Subject: [PATCH 0091/2377] README.md --- README.md | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4909fb4f2..9095cf00f 100644 --- a/README.md +++ b/README.md @@ -12,45 +12,46 @@ ## 脚本列表 -> 详细的脚本介绍、使用说明、截图,请点击第三列的 **安装** 前往 GreasyFork 查看。 +> _详细的脚本介绍、使用说明、截图、更新日志,请点击第三列的 **安装** 前往 GreasyFork 查看。_ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| | **Github 增强** | 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | -| | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、右键显示菜单、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | -| | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | -| | **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| | **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | - -> 脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)! -> 所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过! +| [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| [](https://github.com/XIU2) | **Github 增强** | 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| [](https://bbs.3dmgame.com) | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、右键显示菜单、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | +| [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | + +> _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ +> _所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过!_ **** ## 如何安装/使用脚本? -要使用该脚本,需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e)** \| **[Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/)** \| **[Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** +要使用脚本,首先需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e)** / **[Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/)** / **[Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** -安装扩展后,点击上面第三列 **安装**,再点击 **\[安装脚本\]** 后扩展会弹出提示,点击 **\[安装\]** 即可。 +点击表格 **安装** 进入 GreasyFork 网页,点击 **\[安装脚本\]** 后弹出扩展提示,再点击 **\[安装\]** 即可。 +如果 GreasyFork 访问速度太慢,可以选择点击 **备用** 后弹出扩展提示,再去点击 **\[安装\]** 即可。 -> 其他基于 **Chromium** 内核的浏览器(如国内套皮浏览器)都可以使用 Chrome 的扩展。 +> _其他基于 **Chromium** 内核的浏览器(如国内套皮浏览器)一般都可以使用 Chrome 扩展。_ -> 请确保使用 **Tampermonkey** 扩展,其他的用户脚本管理器可能导致**无法正常使用**脚本。 +> _请确保使用 **Tampermonkey** 扩展,其他的用户脚本管理器可能导致**无法正常使用**脚本。_ > _**不会离线安装 .crx 扩展?[Chrome、Edge 重新开启隐藏的 [拖入安装 .crx 扩展] 功能!](https://zhuanlan.zhihu.com/p/276027099)**_ **** -## 许可证 +## License The GPL-3.0 License. From a3cd317d5ddf245d6468fe4291b0a2fd1b8b0f35 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:04:06 +0800 Subject: [PATCH 0092/2377] README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9095cf00f..c5cdef45a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ## 脚本列表 -> _详细的脚本介绍、使用说明、截图、更新日志,请点击第三列的 **安装** 前往 GreasyFork 查看。_ +> _详细的**脚本介绍、使用说明、截图、更新日志**等,请点击第三列的 **\[安装 \]** 前往 GreasyFork 网页查看。_ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | @@ -38,13 +38,12 @@ ## 如何安装/使用脚本? -要使用脚本,首先需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e)** / **[Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/)** / **[Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** +要使用任何脚本,首先需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://xiu.lanzoux.com/b073l8d1e)** / **[Firefox](https://addons.mozilla.org/firefox/addon/tampermonkey/)** / **[Edge](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd?hl=zh-CN))。** -点击表格 **安装** 进入 GreasyFork 网页,点击 **\[安装脚本\]** 后弹出扩展提示,再点击 **\[安装\]** 即可。 -如果 GreasyFork 访问速度太慢,可以选择点击 **备用** 后弹出扩展提示,再去点击 **\[安装\]** 即可。 +- 点击表格 **\[安装\]** 进入 GreasyFork 网页,点击 **\[安装脚本\]** 后弹出扩展提示,再点击 **\[安装\]** 即可。 +- 如果 GreasyFork 访问速度太慢,可以选择点击 **\[备用\]** 后弹出扩展提示,再去点击 **\[安装\]** 即可。 > _其他基于 **Chromium** 内核的浏览器(如国内套皮浏览器)一般都可以使用 Chrome 扩展。_ - > _请确保使用 **Tampermonkey** 扩展,其他的用户脚本管理器可能导致**无法正常使用**脚本。_ > _**不会离线安装 .crx 扩展?[Chrome、Edge 重新开启隐藏的 [拖入安装 .crx 扩展] 功能!](https://zhuanlan.zhihu.com/p/276027099)**_ From fb1a4105734e948de4ec84c73f3190fbfdf1b54a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:08:18 +0800 Subject: [PATCH 0093/2377] README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c5cdef45a..c52e149ec 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,17 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| [](https://github.com/XIU2) | **Github 增强** | 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| [](https://bbs.3dmgame.com) | **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、右键显示菜单、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 增强** | 自动签到、**自动回复**、自动无缝翻页、清理置顶帖子、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、自动无缝翻页 | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页** | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | | [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | From 553b8352bd3891bf958e983637527ebdf9ab9dbc Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 27 Feb 2021 12:36:17 +0800 Subject: [PATCH 0094/2377] =?UTF-8?q?=E8=B0=83=E6=95=B4=20Description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 5bb7d55e1..471c58edc 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 蓝奏云网盘增强 // @version 1.2.0 // @author X.I.U -// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、调整描述(话说)编辑框初始大小、拖入文件自动显示上传框 +// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* From 543b0738bcd38ee254fd1a83e9230e7a362a8530 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 27 Feb 2021 12:51:46 +0800 Subject: [PATCH 0095/2377] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E9=80=82?= =?UTF-8?q?=E9=85=8D=20Github=20=E6=A0=B7=E5=BC=8F=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=EF=BC=88Release=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index a588396b2..033ee2bbc 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.5 +// @version 1.3.6 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -120,7 +120,7 @@ $(this).next().after(html); }); // 修改[文件大小]元素样式 - document.querySelectorAll('small.pl-2.text-gray.flex-shrink-0').forEach(el=>el.style.cssText='display: flex; justify-content: flex-end; flex-grow: 1; margin-right: 8px;'); + document.querySelectorAll('small.pl-2.color-text-secondary.flex-shrink-0').forEach(el=>el.style.cssText='display: flex; justify-content: flex-end; flex-grow: 1; margin-right: 8px;'); // Source Code From ebd3090f5589ceb0493a8fb363ff797c860184ed Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 28 Feb 2021 10:57:10 +0800 Subject: [PATCH 0096/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=EF=BC=88=E8=BF=99=E6=A0=B7=E8=87=AA=E5=8A=A8=E6=89=93=E5=BC=80?= =?UTF-8?q?/=E5=A4=8D=E5=88=B6=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B8=8D=E4=BC=9A=E4=B8=80=E9=97=AA=E8=80=8C?= =?UTF-8?q?=E8=BF=87=E4=BA=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 82 +++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 471c58edc..0bc455c5f 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.2.0 +// @version 1.2.1 // @author X.I.U // @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* @@ -91,9 +91,9 @@ }; - if(document.getElementById("infos")){ // 分享链接文件列表页 - setTimeout(fileMoreS, 300); // 自动显示更多文件 - }else if(document.querySelector("iframe.ifr2")){ // 分享链接文件下载页(暂时没有这方面的功能,先空着) + if(document.getElementById("infos")){ // 分享链接文件列表页 + setTimeout(fileMoreS, 300); // 自动显示更多文件 + }else if(document.querySelector("iframe.ifr2")){ // 分享链接文件下载页(暂时没有这方面的功能,先空着) //console.log() }else if(document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1){ // 后台页 if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){ @@ -107,16 +107,17 @@ // 获取 iframe 框架 function iframe() { mainframe = document.getElementById("mainframe"); - if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 + if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本 mainframe = mainframe.contentWindow; if(menu_refreshCorrection){ - refreshCorrection(); // 刷新不返回根目录(F5) + refreshCorrection(); // 刷新不返回根目录(F5) } - setTimeout(folderDescdes, 200); // 调整话说编辑框初始大小 - fobiddenBack(); // 禁止浏览器返回(并绑定新的返回事件) - EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] + setTimeout(folderDescdes, 200); // 调整话说编辑框初始大小 + setTimeout(hideSha, 200); // 隐藏分享链接窗口(这样自动打开/复制分享链接时,不会一闪而过) + fobiddenBack(); // 禁止浏览器返回(并绑定新的返回事件) + EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] - dragEnter(); // 拖入文件自动显示上传框 + dragEnter(); // 拖入文件自动显示上传框 } } @@ -154,9 +155,9 @@ // 右键文件显示菜单 function rightClickMenu() { - if(menu_rightClickMenu){ // 脚本菜单开启时才继续 + if(menu_rightClickMenu){ // 脚本菜单开启时才继续 rightClickMenu_("sub_folder_list", "fols", "folse") // 文件夹 - rightClickMenu_("filelist", "fs", "fse") // 文件 + rightClickMenu_("filelist", "fs", "fse") // 文件 } } @@ -164,10 +165,10 @@ // 右键文件显示菜单,参数:文件/文件夹列表 ID、菜单 ID 前缀 function rightClickMenu_(list_id_name, menu_id_name_prefix, list_id_name_prefix) { let list_ = mainframe.document.getElementById(list_id_name); - if(list_){ // 文件/文件夹列表 + if(list_){ // 文件/文件夹列表 list_.oncontextmenu = function(e){ - e.preventDefault(); // 屏蔽浏览器自身右键菜单 - let left = e.pageX - 30; // 右键菜单弹出位置 + e.preventDefault(); // 屏蔽浏览器自身右键菜单 + let left = e.pageX - 30; // 右键菜单弹出位置 let list_ID = e.target.id; if(e.target.nodeName == "FONT"){ list_ID = e.target.parentNode.parentNode.id @@ -188,9 +189,9 @@ // 自动显示更多文件(后台页) function fileMore() { let filemore = mainframe.document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 - if(filemore && filemore.style.display == "block"){ // 判断按钮是否存在且可见 - if(filemore.children[0]){ // 判断按钮元素下第一个元素是否存在 - filemore.children[0].click(); // 点击 [显示更多文件] 按钮 + if(filemore && filemore.style.display == "block"){ // 判断按钮是否存在且可见 + if(filemore.children[0]){ // 判断按钮元素下第一个元素是否存在 + filemore.children[0].click(); // 点击 [显示更多文件] 按钮 } } } @@ -199,8 +200,8 @@ // 自动显示更多文件(分享链接列表页) function fileMoreS() { let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 - if(filemore && filemore.style.display != "none"){ // 判断按钮是否存在且可见 - filemore.click(); // 点击 [显示更多文件] 按钮 + if(filemore && filemore.style.display != "none"){ // 判断按钮是否存在且可见 + filemore.click(); // 点击 [显示更多文件] 按钮 } } @@ -209,15 +210,15 @@ function folderDescdes() { if(menu_folderDescdesMenu) { let folderdescdes = mainframe.document.getElementById("folder_descdes"); // 寻找话说(描述)编辑框 - if(folderdescdes){ // 判断话说(描述)元素是否存在 + if(folderdescdes){ // 判断话说(描述)元素是否存在 folderdescdes.style.cssText="margin: 15px 0px; width: 550px; height: 125px;" } - let folderdescdes2 = mainframe.document.getElementById("fol_credes"); // 寻找话说(描述)编辑框 - if(folderdescdes2){ // 判断话说(描述)元素是否存在 + let folderdescdes2 = mainframe.document.getElementById("fol_credes"); // 寻找话说(描述)编辑框 + if(folderdescdes2){ // 判断话说(描述)元素是否存在 folderdescdes2.style.cssText="margin: 15px 0px; width: 550px; height: 125px;" } - let folderdescdes3 = mainframe.document.getElementById("file_desc"); // 寻找话说(描述)编辑框 - if(folderdescdes3){ // 判断话说(描述)元素是否存在 + let folderdescdes3 = mainframe.document.getElementById("file_desc"); // 寻找话说(描述)编辑框 + if(folderdescdes3){ // 判断话说(描述)元素是否存在 folderdescdes3.style.cssText="margin: 15px 0px; width: 550px; height: 125px;" } } @@ -241,11 +242,11 @@ // 分享链接相关(点击文件时) function fileSha() { var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框 - if(f_sha && f_sha.style.display == "block"){ // 判断信息框是否存在且可见 - fileSha_Open(); // 自动打开分享链接(点击文件时) - fileSha_Copy(); // 自动复制分享链接(点击文件时) + if(f_sha && f_sha.style.display == "block"){ // 判断信息框是否存在且可见 + fileSha_Open(); // 自动打开分享链接(点击文件时) + fileSha_Copy(); // 自动复制分享链接(点击文件时) if(menu_open_fileSha || menu_copy_fileSha){ - f_sha.style.display = "none"; // 隐藏分享链接(下载链接)信息框 + f_sha.style.display = "none"; // 隐藏分享链接(下载链接)信息框 } } } @@ -253,10 +254,10 @@ // 自动打开分享链接(点击文件时) function fileSha_Open() { - if(menu_open_fileSha){ // 脚本菜单开启时才继续 + if(menu_open_fileSha){ // 脚本菜单开启时才继续 let code = mainframe.document.getElementById("code").getAttribute("title"); // 获取分享链接(下载链接) - if(code != ""){ // 确保分享链接(下载链接)不是空 - window.GM_openInTab(code, {active: true,insert: true,setParent: true}) // 打开分享链接(下载链接) + if(code != ""){ // 确保分享链接(下载链接)不是空 + window.GM_openInTab(code, {active: true,insert: true,setParent: true}) // 打开分享链接(下载链接) } } } @@ -264,10 +265,10 @@ // 自动复制分享链接(点击文件时) function fileSha_Copy() { - if(menu_copy_fileSha){ // 脚本菜单开启时才继续 + if(menu_copy_fileSha){ // 脚本菜单开启时才继续 let f_sha1 = mainframe.document.getElementById("f_sha1").innerText; // 获取分享链接(下载链接) - if(f_sha1 != ""){ // 确保分享链接(下载链接)不是空 - copyToClipboard(f_sha1); // 复制到剪切板 + if(f_sha1 != ""){ // 确保分享链接(下载链接)不是空 + copyToClipboard(f_sha1); // 复制到剪切板 } } } @@ -290,6 +291,17 @@ } + // 隐藏分享链接窗口(这样自动打开/复制分享链接时,不会一闪而过) + function hideSha(){ + if(menu_open_fileSha || menu_copy_fileSha){ // [自动复制分享链接] 或 [自动打开分享链接] 任意一个功能开启时才继续 + let style_Add = mainframe.document.createElement('style'); + style_Add.type = 'text/css'; + style_Add.innerHTML = `#f_sha {display: none !important;}`; + mainframe.document.head.appendChild(style_Add); + } + } + + // 禁止浏览器返回(并绑定新的返回事件) function fobiddenBack() { history.pushState(null, null, document.URL); From a337525de7b36d0d0e53b4c14b9e65d70e1f3d2b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 28 Feb 2021 11:09:22 +0800 Subject: [PATCH 0097/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0=E6=96=B9=E5=BC=8F=EF=BC=88=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=90=8E=E5=8F=B0=E6=89=93=E5=BC=80=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=B9=B6=E7=AB=8B=E5=8D=B3=E5=85=B3=E9=97=AD?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=BD=B1=E5=93=8D=E5=89=8D=E5=8F=B0=E8=A7=82?= =?UTF-8?q?=E6=84=9F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index e18751b45..5a8c48124 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.0 +// @version 1.2.1 // @author X.I.U // @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* @@ -150,7 +150,8 @@ // 搜索结果列表 curSite = DBSite.search; }else if(location.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){ - qianDaoBack(); // 先看看是不是签到跳转页面,如果是则返回 + window.opener=null;window.open('','_self');window.close(); + //qianDaoBack(); // 先看看是不是签到跳转页面,如果是则返回 } curSite.pageUrl = ""; // 下一页URL @@ -186,10 +187,12 @@ function qianDao() { var qiandao = document.querySelector('#um p:last-child a:first-child'); if (qiandao){ - if(qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2") - { - qiandao.click(); - } + //if(qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2") + //{ + window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 + qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] + //qiandao.click(); + //} } } From 25185ed5f6f77763dba4e660af30731b0f4fecd6 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 28 Feb 2021 11:16:22 +0800 Subject: [PATCH 0098/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0=E6=96=B9=E5=BC=8F=EF=BC=88=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=90=8E=E5=8F=B0=E6=89=93=E5=BC=80=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=B9=B6=E7=AB=8B=E5=8D=B3=E5=85=B3=E9=97=AD?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=BD=B1=E5=93=8D=E5=89=8D=E5=8F=B0=E8=A7=82?= =?UTF-8?q?=E6=84=9F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 5a8c48124..f91effb01 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -198,12 +198,12 @@ // 签到后立即返回 - function qianDaoBack() { + /*function qianDaoBack() { var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a'); if (qiandaoback){ setTimeout(function(){qiandaoback.click()}, 200); } - } + }*/ // 滚动条事件 From 84b0d18470debbb0cb32876eb2af4108ec9ea759 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 3 Mar 2021 20:52:27 +0800 Subject: [PATCH 0099/2377] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20[=E6=97=A5?= =?UTF-8?q?=E6=9C=AC=E4=B8=9C=E4=BA=AC]=20=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 033ee2bbc..7e12d0b6e 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.6 +// @version 1.3.7 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -28,7 +28,7 @@ ['https://gh.con.sh','美国'], ['https://gh.api.99988866.xyz','美国'], ['https://download.fastgit.org','日本东京'], - ['https://github.xiu2.xyz','日本东京'], + ['https://gh.xiu2.xyz','日本东京'], ['https://ghproxy.com','韩国首尔'], ['https://pd.zwc365.com/seturl','中国香港'] ], From e4542036ba0ec947c669783c2c6d120901e2bc4f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 3 Mar 2021 21:33:31 +0800 Subject: [PATCH 0100/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 7e12d0b6e..c0bb77153 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -21,7 +21,7 @@ var backColor = '#ffffff'; var fontColor = '#888888'; if('dark' == $('html').attr('data-color-mode')){ // 黑暗模式判断 - backColor = '#0D1117'; + backColor = '#161a21'; fontColor = '#b2b8bf'; } var download_url = [ @@ -114,7 +114,7 @@ html = `
    `; for (let i=0;i${download_url[i][1]}
    ` + html = html + `${download_url[i][1]}` } html = html + `` $(this).next().after(html); @@ -137,7 +137,7 @@ html = `
    `; for (let i=0;i${download_url[i][1]}
    ` + html = html + `${download_url[i][1]}` } html = html + `` $(this).after(html); From 738078050dbefb411ec52805be1b96f96163d1f4 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 5 Mar 2021 08:45:58 +0800 Subject: [PATCH 0101/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E7=AB=99=E6=94=AF=E6=8C=81=EF=BC=88hub.fastgit.org?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index c0bb77153..d3104315f 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,9 +1,10 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.7 +// @version 1.3.8 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* +// @match *://hub.fastgit.org/* // @icon https://github.com/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @grant GM_registerMenuCommand From 9f42f2838b1dd69fa689a2268b4efcfad075e336 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 5 Mar 2021 09:31:35 +0800 Subject: [PATCH 0102/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=85=B3=E9=80=9A=E7=9F=A5=203=20=E7=A7=92?= =?UTF-8?q?=E5=90=8E=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD=EF=BC=88=E9=9A=90?= =?UTF-8?q?=E8=97=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 20 ++++++++++---------- 52pojie-Beautification.user.js | 6 +++--- 52pojie-Enhanced.user.js | 6 +++--- GithubEnhanced-High-Speed-Download.user.js | 4 ++-- Hostloc-Enhanced.user.js | 6 +++--- Lanzou-Enhanced.user.js | 6 +++--- Zhihu-Beautification.user.js | 8 ++++---- Zhihu-Enhanced.user.js | 6 +++--- Zhiyoo-Enhanced.user.js | 8 ++++---- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index c4567c873..fa029f8fb 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 3DM论坛增强 -// @version 1.0.6 +// @version 1.0.7 // @author X.I.U // @description 自动回复、自动无缝翻页、清理置顶帖子 // @match *://bbs.3dmgame.com/* @@ -60,10 +60,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); } registerMenuCommand(); // 重新注册脚本菜单 }; @@ -124,9 +124,9 @@ // 用于脚本内部判断当前 URL 类型 let SiteType = { - FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 + FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 THREAD: DBSite.thread.SiteTypeID, // 帖子内 - GUIDE: DBSite.guide.SiteTypeID // 导读帖子列表 + GUIDE: DBSite.guide.SiteTypeID // 导读帖子列表 }; // 下一页URL @@ -145,18 +145,18 @@ if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){ // 帖子内 if(menu_thread_pageLoading)curSite = DBSite.thread; - if(menu_autoReply)autoReply(); // 如果有隐藏内容,则自动回复 - pageLoading(); // 自动翻页 + if(menu_autoReply)autoReply(); // 如果有隐藏内容,则自动回复 + pageLoading(); // 自动翻页 if(menu_scrollToShowhide)setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); // 滚动至隐藏内容 }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ // 各板块帖子列表 curSite = DBSite.forum; - if(menu_cleanTopPost)cleanTopPost(); // 清理置顶帖子 - pageLoading(); // 自动翻页 + if(menu_cleanTopPost)cleanTopPost(); // 清理置顶帖子 + pageLoading(); // 自动翻页 }else if (patt_guide.test(location.search)){ // 导读帖子列表 curSite = DBSite.guide; - pageLoading(); // 自动翻页 + pageLoading(); // 自动翻页 } diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index 11d97ed8f..a27797f17 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛美化 -// @version 1.0.4 +// @version 1.0.5 // @author X.I.U // @description 精简多余内容 // @match *://www.52pojie.cn/* @@ -42,10 +42,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); } registerMenuCommand(); // 重新注册脚本菜单 }; diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index f91effb01..388f002c9 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.1 +// @version 1.2.2 // @author X.I.U // @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* @@ -48,10 +48,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`, '吾爱破解论坛增强'); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3500}); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`, '吾爱破解论坛增强'); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3500}); } registerMenuCommand(); // 重新注册脚本菜单 }; diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index d3104315f..0f26a440d 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.8 +// @version 1.3.9 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -80,7 +80,7 @@ GM_setValue('xiu2_menu_raw_fast', menu_raw_fast); delRawDownLink(); // 删除旧加速源 addRawDownLink(); // 添加新加速源 - GM_notification(`已切换加速源为:${raw_url[menu_raw_fast][1]}`); // 提示消息 + GM_notification({text: "已切换加速源为:" + raw_url[menu_raw_fast][1], timeout: 3000}); // 提示消息 registerMenuCommand(); // 重新注册脚本菜单 }; diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 891e37543..bcb84e4e5 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.4 +// @version 1.0.5 // @author X.I.U // @description 自动无缝翻页、自动显示帖子内被隐藏的回复 // @match *://www.hostloc.com/* @@ -48,10 +48,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); } registerMenuCommand(); // 重新注册脚本菜单 }; diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 0bc455c5f..9d6192146 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.2.1 +// @version 1.2.2 // @author X.I.U // @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* @@ -82,10 +82,10 @@ } if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 [${Tips}] 功能${RefreshTips}`); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 [${Tips}] 功能${RefreshTips}`); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); } registerMenuCommand(); // 重新注册脚本菜单 }; diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 39e938208..bcdea3b0e 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.0.5 +// @version 1.0.6 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致 +// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -43,10 +43,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); } registerMenuCommand(); // 重新注册脚本菜单 }; diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index c01f57d0e..b245b73f0 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.2 +// @version 1.2.3 // @author X.I.U // @description 移除登录弹窗、一键收起回答、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -59,10 +59,10 @@ function registerMenuCommand() { function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 [${Tips}] 功能\n(刷新网页后生效)`); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); } registerMenuCommand(); // 重新注册脚本菜单 }; diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 0cb4ecb55..6ceeb87aa 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -39,8 +39,8 @@ if (menu_cleanPostTitle){menu_cleanPostTitle_ = "√";}else{menu_cleanPostTitle_ = "×";} - menu_cleanPostTitle_ID = GM_registerMenuCommand(`[ ${menu_cleanPostTitle_} ] 清理帖子标题开头〖〗【】文字`, function(){menu_switch(menu_cleanPostTitle,'xiu2_menu_cleanPostTitle','[清理帖子标题开头〖〗【】文字] 功能(刷新网页后生效)')}); - menu_qianDaoRedirectURL_ID = GM_registerMenuCommand(`当前页面设为签到后重定向地址`, function(){GM_setValue('xiu2_menu_qianDaoRedirectURL', location.href);GM_notification(`已设置当前页面为签到后重定向地址`);}) + menu_cleanPostTitle_ID = GM_registerMenuCommand(`[ ${menu_cleanPostTitle_} ] 清理帖子标题开头〖〗【】文字`, function(){menu_switch(menu_cleanPostTitle,'xiu2_menu_cleanPostTitle','清理帖子标题开头〖〗【】文字')}); + menu_qianDaoRedirectURL_ID = GM_registerMenuCommand(`当前页面设为签到后重定向地址`, function(){GM_setValue('xiu2_menu_qianDaoRedirectURL', location.href);GM_notification({text: `已设置当前页面为签到后重定向地址`, timeout: 3000});;}) menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -48,10 +48,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification(`已关闭 ${Tips}`); + GM_notification({text: `已关闭 [${Tips}] 功能(刷新网页后生效)`, timeout: 3500}); }else{ GM_setValue(`${Name}`, true); - GM_notification(`已开启 ${Tips}`); + GM_notification({text: `已开启 [${Tips}] 功能(刷新网页后生效)`, timeout: 3500}); } registerMenuCommand(); // 重新注册脚本菜单 }; From 9498c011f2f226d53f8cc254de13ff9ef188294c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 5 Mar 2021 09:39:21 +0800 Subject: [PATCH 0103/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=85=B3=E9=80=9A=E7=9F=A5=203=20=E7=A7=92?= =?UTF-8?q?=E5=90=8E=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD=EF=BC=88=E9=9A=90?= =?UTF-8?q?=E8=97=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 6ceeb87aa..5dfe12cac 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 智友邦论坛增强 -// @version 1.1.5 +// @version 1.1.6 // @author X.I.U // @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件兑换/下载、清理帖子标题〖XXX〗【XXX】文字 // @icon http://bbs.zhiyoo.net/favicon.ico From 8ad2fcc00c8bdd3975ca414b9b7c9ebdcb183edf Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 7 Mar 2021 11:14:31 +0800 Subject: [PATCH 0104/2377] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=9B=BE=E6=A0=87=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 0f26a440d..009d02678 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -5,7 +5,7 @@ // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @match *://hub.fastgit.org/* -// @icon https://github.com/favicon.ico +// @icon https://i.loli.net/2021/03/07/oUHPFSOTjKnkMzJ.png // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand From 0ded108ad60b58c040669f8ae7765e1377948668 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 7 Mar 2021 22:09:47 +0800 Subject: [PATCH 0105/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[PubMed]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=EF=BC=9B=E6=9B=B4=E6=8D=A2=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=9B=BE=E6=A0=87=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index f8b1be387..d4ba364ae 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.2 +// @version 1.1.3 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化)、小众软件 +// @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化)、小众软件、PubMed // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -10,7 +10,8 @@ // @match *://www.appinn.com/ // @match *://www.appinn.com/*/*/ // @match *://www.appinn.com/?s=* -// @icon https://s3.ax1x.com/2021/02/25/yj2s4f.png +// @match *://pubmed.ncbi.nlm.nih.gov/?term=* +// @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_openInTab @@ -31,6 +32,7 @@ postslist_423down: { SiteTypeID: 1, pager: { + type: 1, nextLink: '//div[@class="paging"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div.content-wrap ul.excerpt > li', HT_insert: ['css;div.content-wrap ul.excerpt', 2], @@ -41,6 +43,7 @@ postslist_apphot: { SiteTypeID: 2, pager: { + type: 1, nextLink: '//div[@class="pagination"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div.content > article.excerpt', HT_insert: ['css;div.pagination', 1], @@ -51,12 +54,21 @@ postslist_appinn: { SiteTypeID: 3, pager: { + type: 1, nextLink: '//a[@class="next page-numbers"][@href]', pageElement: 'css;section#latest-posts > article', HT_insert: ['css;nav.navigation.pagination', 1], replaceE: 'css;div.nav-links', scrollDelta: 1500 } + }, + postslist_pubmed: { + SiteTypeID: 4, + pager: { + type: 2, + nextLink: 'button.load-button.next-page', + scrollDelta: 1000 + } } }; @@ -64,7 +76,8 @@ let SiteType = { POSTSLIST_423DOWN: DBSite.postslist_423down.SiteTypeID, POSTSLIST_APPHOT: DBSite.postslist_apphot.SiteTypeID, - POSTSLIST_APPINN: DBSite.postslist_appinn.SiteTypeID + POSTSLIST_APPINN: DBSite.postslist_appinn.SiteTypeID, + POSTSLIST_PUBMED: DBSite.postslist_pubmed.SiteTypeID }; switch (location.host) { @@ -77,6 +90,9 @@ case "www.appinn.com": curSite = DBSite.postslist_appinn; break; + case "pubmed.ncbi.nlm.nih.gov": + curSite = DBSite.postslist_pubmed; + break; } curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动无缝翻页 @@ -87,11 +103,18 @@ if (curSite.SiteTypeID > 0){ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 - var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; - console.log(document.documentElement.scrollHeight) + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + //console.log(document.documentElement.scrollHeight) let scrollDelta = curSite.pager.scrollDelta; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { - ShowPager.loadMorePage(); + if (curSite.pager.type === 1) { + ShowPager.loadMorePage(); + }else{ + let autopbn = document.querySelector(curSite.pager.nextLink); + if (autopbn){ + autopbn.click(); + } + } } } }); From 4a8df229e69b76338af54c664d88d3389d762843 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 7 Mar 2021 22:33:23 +0800 Subject: [PATCH 0106/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[PubMed]=20?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E7=81=B5=E6=95=8F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Autopage.user.js b/Autopage.user.js index d4ba364ae..33be28646 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -67,7 +67,7 @@ pager: { type: 2, nextLink: 'button.load-button.next-page', - scrollDelta: 1000 + scrollDelta: 1500 } } }; From c43cba98a95e84b9fdef671d4d9af746f6ff7dd8 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 8 Mar 2021 02:04:02 +0800 Subject: [PATCH 0107/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 121 +++++++++++++-------------------------- 1 file changed, 40 insertions(+), 81 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 388f002c9..bfaf0e30d 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -48,10 +48,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3500}); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3000}); }else{ GM_setValue(`${Name}`, true); - GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3500}); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3000}); } registerMenuCommand(); // 重新注册脚本菜单 }; @@ -61,7 +61,7 @@ // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; - // 自动翻页规则,scrollDelta 数值越大,滚动条触发点越高 + // 自动翻页规则,scrollDelta 数值越大,滚动条触发点越靠上 let DBSite = { forum: { SiteTypeID: 1, @@ -113,15 +113,15 @@ // 用于脚本内部判断当前 URL 类型 let SiteType = { - FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 - THREAD: DBSite.thread.SiteTypeID, // 帖子内 - GUIDE: DBSite.guide.SiteTypeID, // 导读帖子列表 - COLLECTION: DBSite.collection.SiteTypeID, // 淘贴列表 - SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 + FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 + THREAD: DBSite.thread.SiteTypeID, // 帖子内 + GUIDE: DBSite.guide.SiteTypeID, // 导读帖子列表 + COLLECTION: DBSite.collection.SiteTypeID, // 淘贴列表 + SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 }; // URL 匹配正则表达式 - var patt_thread = /\/thread-\d+-\d+\-\d+.html/, + let patt_thread = /\/thread-\d+-\d+\-\d+.html/, patt_thread_2 = /mod\=viewthread/, patt_forum = /\/forum-\d+-\d+\.html/, patt_forum_2 = /mod\=forumdisplay/, @@ -131,46 +131,39 @@ // URL 判断 if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){ - // 帖子内 if(menu_thread_pageLoading) { - curSite = DBSite.thread; - hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + curSite = DBSite.thread; // 帖子内 + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 } }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ - // 各板块帖子列表 - curSite = DBSite.forum; + curSite = DBSite.forum; // 各板块帖子列表 }else if (patt_guide.test(location.search)){ - // 导读帖子列表 - curSite = DBSite.guide; - delateReward(); // 屏蔽悬赏贴(导读-最新发表) + curSite = DBSite.guide; // 导读帖子列表 + delateReward(); // 屏蔽悬赏贴(导读-最新发表) }else if (patt_collection.test(location.search)){ - // 淘贴列表 - curSite = DBSite.collection; + curSite = DBSite.collection; // 淘贴列表 }else if(location.pathname === '/search.php'){ - // 搜索结果列表 - curSite = DBSite.search; + curSite = DBSite.search; // 搜索结果列表 }else if(location.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){ - window.opener=null;window.open('','_self');window.close(); - //qianDaoBack(); // 先看看是不是签到跳转页面,如果是则返回 + window.opener=null;window.open('','_self');window.close(); // 关闭当前网页标签页 } curSite.pageUrl = ""; // 下一页URL - qianDao(); // 看看有没有签到 - pageLoading(); // 自动翻页 + qianDao(); // 看看有没有签到 + pageLoading(); // 自动翻页 // 自动翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ windowScroll(function (direction, e) { - //console.log('1111111') if (direction === "down") { // 下滑才准备翻页 - var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; let scrollDelta = curSite.pager.scrollDelta; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { if (curSite.SiteTypeID === SiteType.FORUM) { // 如果是原创、精品等版块则直接点下一页就行了 - var autopbn = document.querySelector('#autopbn'); - if (autopbn && autopbn.innerText == "下一页 »"){ // 如果已经在加载中了,就忽略 + let autopbn = document.querySelector('#autopbn'); + if (autopbn && autopbn.innerText == "下一页 »"){ // 如果没有在加载时,再去点击,免得一不注意加载几十页 autopbn.click(); } }else{ @@ -185,47 +178,19 @@ // 自动签到 function qianDao() { - var qiandao = document.querySelector('#um p:last-child a:first-child'); + let qiandao = document.querySelector('#um p:last-child a:first-child'); if (qiandao){ - //if(qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2") - //{ window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] - //qiandao.click(); - //} + qiandao.href = "#" // 修改 URL 为 # } } - // 签到后立即返回 - /*function qianDaoBack() { - var qiandaoback = document.querySelector('#messagetext p.alert_btnleft a'); - if (qiandaoback){ - setTimeout(function(){qiandaoback.click()}, 200); - } - }*/ - - - // 滚动条事件 - function windowScroll(fn1) { - var beforeScrollTop = document.documentElement.scrollTop, - fn = fn1 || function () {}; - setTimeout(function () { // 延时执行,避免刚载入到页面就触发翻页事件 - window.addEventListener("scroll", function (e) { - var afterScrollTop = document.documentElement.scrollTop, - delta = afterScrollTop - beforeScrollTop; - if (delta == 0) return false; - fn(delta > 0 ? "down" : "up", e); - beforeScrollTop = afterScrollTop; - }, false); - }, 1000) - } - - //屏蔽悬赏贴(导读-最新发表) function delateReward(){ if(patt_guide_newthread.test(location.search) && menu_delateReward){ - var table = document.querySelector("#threadlist > div.bm_c > table"), + let table = document.querySelector("#threadlist > div.bm_c > table"), tbodys = table.getElementsByTagName('tbody'), arrs = []; for (let i=0; i 0 ? "down" : "up", e); + beforeScrollTop = afterScrollTop; + }, false); + }, 1000) + } + // 自动无缝翻页,修改自 https://greasyfork.org/scripts/14178 function showPager() { From e2b497a63cf30c428857de57c1f3281cef59952d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 8 Mar 2021 10:21:35 +0800 Subject: [PATCH 0108/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index bcb84e4e5..b360eba7c 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -102,7 +102,7 @@ }; // URL 匹配正则表达式 - var patt_thread = /\/thread-\d+-\d+\-\d+.html/, + let patt_thread = /\/thread-\d+-\d+\-\d+.html/, patt_thread_2 = /mod\=viewthread/, patt_forum = /\/forum-\d+-\d+\.html/, patt_forum_2 = /mod\=forumdisplay/, @@ -134,11 +134,11 @@ if (curSite.SiteTypeID > 0){ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 - var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; let scrollDelta = 766; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { if (curSite.SiteTypeID === SiteType.FORUM) { // 如果是各版块帖子列表则直接点下一页就行了 - var autopbn = document.querySelector('#autopbn'); + let autopbn = document.querySelector('#autopbn'); if (autopbn && autopbn.innerText == "下一页 »"){ // 如果已经在加载中了,就忽略 autopbn.click(); } @@ -155,7 +155,7 @@ // 自动显示帖子内被隐藏的回复 function showPosts() { if(menu_showhide){ - var showposts = document.querySelector('#hiddenpoststip a'); + let showposts = document.querySelector('#hiddenpoststip a'); if (showposts){ // 如果存在 showposts.click(); } From 2db660affa8739ca198022e75a7667c3af7efd3e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 10 Mar 2021 10:51:09 +0800 Subject: [PATCH 0109/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=AB=99=E5=A4=96=E7=9B=B4=E9=93=BE]=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=8F=9C=E5=8D=95=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 69 +++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index b245b73f0..25abbc814 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.3 +// @version 1.2.4 // @author X.I.U // @description 移除登录弹窗、一键收起回答、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -18,40 +18,46 @@ // @namespace https://greasyfork.org/scripts/412205 // ==/UserScript== -var menu_collapsedAnswer = GM_getValue('xiu2_menu_collapsedAnswer'); -var menu_publishTop = GM_getValue('xiu2_menu_publishTop'); -var menu_allTime = GM_getValue('xiu2_menu_allTime'); -var menu_typeTips = GM_getValue('xiu2_menu_typeTips'); -var menu_collapsedAnswer_ID, menu_publishTop_ID, menu_typeTips_ID, menu_allTime_ID, menu_feedBack_ID; +var menu_collapsedAnswer = GM_getValue('xiu2_menu_collapsedAnswer'), + menu_publishTop = GM_getValue('xiu2_menu_publishTop'), + menu_allTime = GM_getValue('xiu2_menu_allTime'), + menu_typeTips = GM_getValue('xiu2_menu_typeTips'), + menu_directLink = GM_getValue('xiu2_menu_directLink'), + menu_collapsedAnswer_ID, menu_publishTop_ID, menu_typeTips_ID, menu_allTime_ID, menu_directLink_ID, menu_feedBack_ID; if (menu_collapsedAnswer == null){menu_collapsedAnswer = true; GM_setValue('xiu2_menu_collapsedAnswer', menu_collapsedAnswer)}; if (menu_publishTop == null){menu_publishTop = true; GM_setValue('xiu2_menu_publishTop', menu_publishTop)}; if (menu_typeTips == null){menu_typeTips = true; GM_setValue('xiu2_menu_typeTips', menu_typeTips)}; if (menu_allTime == null){menu_allTime = true; GM_setValue('xiu2_menu_allTime', menu_allTime)}; +if (menu_directLink == null){menu_directLink = true; GM_setValue('xiu2_menu_directLink', menu_directLink)}; registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_collapsedAnswer_, menu_publishTop_, menu_typeTips_, menu_allTime_; + var menu_collapsedAnswer_, menu_publishTop_, menu_typeTips_, menu_allTime_, menu_directLink_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_collapsedAnswer_ID); GM_unregisterMenuCommand(menu_publishTop_ID); GM_unregisterMenuCommand(menu_typeTips_ID); + GM_unregisterMenuCommand(menu_directLink_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_collapsedAnswer = GM_getValue('xiu2_menu_collapsedAnswer'); menu_publishTop = GM_getValue('xiu2_menu_publishTop'); menu_allTime = GM_getValue('xiu2_menu_allTime'); menu_typeTips = GM_getValue('xiu2_menu_typeTips'); + menu_directLink = GM_getValue('xiu2_menu_directLink'); } if (menu_collapsedAnswer){menu_collapsedAnswer_ = "√";}else{menu_collapsedAnswer_ = "×";} if (menu_publishTop){menu_publishTop_ = "√";}else{menu_publishTop_ = "×";} if (menu_typeTips){menu_typeTips_ = "√";}else{menu_typeTips_ = "×";} if (menu_allTime){menu_allTime_ = "√";}else{menu_allTime_ = "×";} + if (menu_directLink){menu_directLink_ = "√";}else{menu_directLink_ = "×";} menu_collapsedAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedAnswer_} ] 一键收起回答`, function(){menu_switch(menu_collapsedAnswer,'xiu2_menu_collapsedAnswer','一键收起回答')}); menu_publishTop_ID = GM_registerMenuCommand(`[ ${menu_publishTop_} ] 置顶显示时间`, function(){menu_switch(menu_publishTop,'xiu2_menu_publishTop','置顶显示时间')}); menu_publishTop_ID = GM_registerMenuCommand(`[ ${menu_allTime_} ] 完整显示时间`, function(){menu_switch(menu_allTime,'xiu2_menu_allTime','完整显示时间')}); menu_typeTips_ID = GM_registerMenuCommand(`[ ${menu_typeTips_} ] 区分问题文章`, function(){menu_switch(menu_typeTips,'xiu2_menu_typeTips','区分问题文章')}); + menu_directLink_ID = GM_registerMenuCommand(`[ ${menu_directLink_} ] 默认站外直链`, function(){menu_switch(menu_directLink,'xiu2_menu_directLink','默认站外直链')}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -288,6 +294,7 @@ function directLink () { else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { external_href = $(this).attr("href"); new_href = external_href.substring(external_href = $(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); + console.log(`${new_href}`) $(this).attr("href", decodeURIComponent(new_href)); } else { @@ -470,36 +477,36 @@ function EventXMLHttpRequest() { } }) - setInterval(originalPic,100); // 默认高清原图 - setInterval(directLink, 100); // 默认站外直链 + setInterval(originalPic,100); // 默认高清原图 + if(menu_directLink) setInterval(directLink, 100); // 默认站外直链 //每个页面对应的功能函数 - if(window.location.href.indexOf("question") > -1){ // 回答页 // + if(window.location.href.indexOf("question") > -1){ // 回答页 // if(window.location.href.indexOf("waiting") == -1){ - collapsedAnswer(); // 一键收起回答 + collapsedAnswer(); // 一键收起回答 } - setInterval(topTime_question, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("search") > -1){ // 搜索结果页 // - collapsedAnswer(); // 一键收起回答 - setInterval(topTime_search, 300); // 置顶显示时间 - EventXMLHttpRequest(); // 区分问题文章 - }else if(window.location.href.indexOf("topic") > -1){ // 话题页 // + setInterval(topTime_question, 300); // 置顶显示时间 + }else if(window.location.href.indexOf("search") > -1){ // 搜索结果页 // + collapsedAnswer(); // 一键收起回答 + setInterval(topTime_search, 300); // 置顶显示时间 + EventXMLHttpRequest(); // 区分问题文章 + }else if(window.location.href.indexOf("topic") > -1){ // 话题页 // if(window.location.href.indexOf("unanswered") == -1){ - collapsedAnswer(); // 一键收起回答 - setInterval(topTime_search, 300); // 置顶显示时间 - EventXMLHttpRequest(); // 区分问题文章 + collapsedAnswer(); // 一键收起回答 + setInterval(topTime_search, 300); // 置顶显示时间 + EventXMLHttpRequest(); // 区分问题文章 } - }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // - setInterval(topTime_zhuanlan, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("column") > -1){ // 专栏 // - collapsedAnswer(); // 一键收起回答 - setInterval(topTime_zhuanlan, 300); // 置顶显示时间 + }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // + setInterval(topTime_zhuanlan, 300); // 置顶显示时间 + }else if(window.location.href.indexOf("column") > -1){ // 专栏 // + collapsedAnswer(); // 一键收起回答 + setInterval(topTime_zhuanlan, 300); // 置顶显示时间 }else if(window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1){ // 用户主页 // - collapsedAnswer(); // 一键收起回答 - setInterval(topTime_people, 300); // 置顶显示时间 - }else{ // 首页 // - collapsedAnswer(); // 一键收起回答 - setInterval(topTime_index, 300); // 置顶显示时间 - EventXMLHttpRequest(); // 区分问题文章 + collapsedAnswer(); // 一键收起回答 + setInterval(topTime_people, 300); // 置顶显示时间 + }else{ // 首页 // + collapsedAnswer(); // 一键收起回答 + setInterval(topTime_index, 300); // 置顶显示时间 + EventXMLHttpRequest(); // 区分问题文章 } })(); \ No newline at end of file From fed110ef8a3ddfc2dca00d87a9898ad85ab55133 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 11 Mar 2021 16:51:52 +0800 Subject: [PATCH 0110/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97]=20=E5=AF=B9?= =?UTF-8?q?=E4=B8=93=E6=A0=8F=E6=96=87=E7=AB=A0=E9=A1=B5=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 25abbc814..22301e7ac 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.4 +// @version 1.2.5 // @author X.I.U // @description 移除登录弹窗、一键收起回答、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -480,31 +480,32 @@ function EventXMLHttpRequest() { setInterval(originalPic,100); // 默认高清原图 if(menu_directLink) setInterval(directLink, 100); // 默认站外直链 - //每个页面对应的功能函数 - if(window.location.href.indexOf("question") > -1){ // 回答页 // + // 每个页面对应的功能函数 + if(window.location.href.indexOf("question") > -1){ // 回答页 // if(window.location.href.indexOf("waiting") == -1){ collapsedAnswer(); // 一键收起回答 } setInterval(topTime_question, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("search") > -1){ // 搜索结果页 // + }else if(window.location.href.indexOf("search") > -1){ // 搜索结果页 // collapsedAnswer(); // 一键收起回答 setInterval(topTime_search, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 - }else if(window.location.href.indexOf("topic") > -1){ // 话题页 // + }else if(window.location.href.indexOf("topic") > -1){ // 话题页 // if(window.location.href.indexOf("unanswered") == -1){ collapsedAnswer(); // 一键收起回答 setInterval(topTime_search, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 } - }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // + }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // + removeLogin(); // 移除登录弹窗 setInterval(topTime_zhuanlan, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("column") > -1){ // 专栏 // + }else if(window.location.href.indexOf("column") > -1){ // 专栏 // collapsedAnswer(); // 一键收起回答 setInterval(topTime_zhuanlan, 300); // 置顶显示时间 }else if(window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1){ // 用户主页 // collapsedAnswer(); // 一键收起回答 setInterval(topTime_people, 300); // 置顶显示时间 - }else{ // 首页 // + }else{ // 首页 // collapsedAnswer(); // 一键收起回答 setInterval(topTime_index, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 From c29d5d0591951b871e01de5d1234dfe861020f02 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 12 Mar 2021 20:42:11 +0800 Subject: [PATCH 0111/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=9B=9E=E7=AD=94=E5=90=91=E4=B8=8B=E7=BF=BB=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=9A=90=E8=97=8F=E6=A0=87=E9=A2=98]?= =?UTF-8?q?=EF=BC=88=E9=BB=98=E8=AE=A4=E5=85=B3=E9=97=AD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 52 ++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index bcdea3b0e..eedb6d201 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.0.6 +// @version 1.0.7 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致 +// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致、浏览回答向下翻时自动隐藏标题 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -18,24 +18,30 @@ // ==/UserScript== (function() { - var menu_postimg = GM_getValue('xiu2_menu_postimg'); - var menu_postimg_ID, menu_feedBack_ID; + var menu_postimg = GM_getValue('xiu2_menu_postimg'), + menu_hideTitle = GM_getValue('xiu2_menu_hideTitle'), + menu_postimg_ID, menu_hideTitle_ID, menu_feedBack_ID; if (menu_postimg == null){menu_postimg = false; GM_setValue('xiu2_menu_postimg', menu_postimg)}; + if (menu_hideTitle == null){menu_hideTitle = false; GM_setValue('xiu2_menu_hideTitle', menu_hideTitle)}; registerMenuCommand(); addStyle(); // 注册脚本菜单 function registerMenuCommand() { - var menu_postimg_; + let menu_postimg_, menu_hideTitle_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_postimg_ID); + GM_unregisterMenuCommand(menu_hideTitle_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_postimg = GM_getValue('xiu2_menu_postimg'); + menu_hideTitle = GM_getValue('xiu2_menu_hideTitle'); } if (menu_postimg){menu_postimg_ = "√";}else{menu_postimg_ = "×";} + if (menu_hideTitle){menu_hideTitle_ = "√";}else{menu_hideTitle_ = "×";} menu_postimg_ID = GM_registerMenuCommand(`[ ${menu_postimg_} ] 隐藏文章开头大图`, function(){menu_switch(menu_postimg,'xiu2_menu_postimg','隐藏文章开头大图')}); + menu_hideTitle_ID = GM_registerMenuCommand(`[ ${menu_hideTitle_} ] 隐藏浏览回答标题`, function(){menu_switch(menu_hideTitle,'xiu2_menu_hideTitle','隐藏浏览回答标题')}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } @@ -43,10 +49,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3000}); }else{ GM_setValue(`${Name}`, true); - GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3000}); } registerMenuCommand(); // 重新注册脚本菜单 }; @@ -54,7 +60,7 @@ // 添加样式 function addStyle() { - var style, + let style, style_1 = ` .GlobalSideBar,.Question-sideColumn,.ContentLayout-sideColumn,.SearchSideBar,.Card.QuestionHeaderTopicMeta { display: none !important; @@ -69,14 +75,11 @@ z-index: 999 !important; } `, - style_2 = ` -/* 隐藏在各列表中查看文章时开头显示的大图,不影响文章、专栏页面 */ + style_2 = `/* 隐藏在各列表中查看文章时开头显示的大图,不影响文章、专栏页面 */ .RichContent img.ArticleItem-image { display: none !important; -} -`, - style_3 = ` -/* 调整文章编辑页面与实际文章宽度一致 */ +}`, + style_3 = `/* 调整文章编辑页面与实际文章宽度一致 */ .PostEditor .RichText { min-width: 690px !important; } @@ -84,14 +87,23 @@ .WriteIndex-titleInput .Input { min-width: 690px !important; font-size: 24px; -} -` - var style_Add = document.createElement('style'); +}`, + style_4 = `/* 浏览回答时,向下翻隐藏顶栏(问题的标题)*/ +header.is-hidden { +display: none; +}` + let style_Add = document.createElement('style'); + // 宽屏显示 + style = style_1; + // 隐藏文章开头大图 if (menu_postimg) { - style = style_1 + style_2; - }else{ - style = style_1; + style += style_2; + } + // 浏览回答向下翻时自动隐藏标题 + if (menu_hideTitle) { + style += style_4; } + // 文章编辑页面与实际文章宽度一致 if(window.location.href.indexOf("zhuanlan") > -1){ if(window.location.href.indexOf("/edit") > -1){ style += style_3; From c1b191e0b39f15a4f37bb4b5151b4a52fbd79d85 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 13 Mar 2021 01:59:36 +0800 Subject: [PATCH 0112/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E8=AE=BA?= =?UTF-8?q?=E5=9D=9B=E6=9A=82=E6=97=B6=E5=85=B3=E9=97=AD=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=90=8E=EF=BC=8C=E8=87=AA=E5=8A=A8=E7=AD=BE?= =?UTF-8?q?=E5=88=B0=E4=BC=9A=E9=87=8D=E5=A4=8D=E6=89=93=E5=BC=80=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=9C=B0=E5=9D=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index bfaf0e30d..6d44091a0 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.2 +// @version 1.2.3 // @author X.I.U // @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* @@ -27,7 +27,7 @@ // 注册脚本菜单 function registerMenuCommand() { - var menu_thread_pageLoading_, menu_delateReward_; + let menu_thread_pageLoading_, menu_delateReward_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_thread_pageLoading_ID); GM_unregisterMenuCommand(menu_delateReward_ID); @@ -179,7 +179,7 @@ // 自动签到 function qianDao() { let qiandao = document.querySelector('#um p:last-child a:first-child'); - if (qiandao){ + if (qiandao && qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){ window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] qiandao.href = "#" // 修改 URL 为 # From 8de5b7e9d63fddc538d8475058c07277bac4cd06 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 13 Mar 2021 16:26:35 +0800 Subject: [PATCH 0113/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E7=82=B9=E5=87=BB=E5=90=8E=E9=A2=9C=E8=89=B2=E5=8F=98?= =?UTF-8?q?=E6=B5=85=E7=81=B0=E8=89=B2]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Beautification.user.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index a27797f17..a99b6d73a 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 吾爱破解论坛美化 -// @version 1.0.5 +// @version 1.0.6 // @author X.I.U -// @description 精简多余内容 +// @description 精简多余内容、样式优化 // @match *://www.52pojie.cn/* // @icon https://www.52pojie.cn/favicon.ico // @grant GM_registerMenuCommand @@ -25,7 +25,7 @@ // 注册脚本菜单 function registerMenuCommand() { - var menu_rule_; + let menu_rule_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_rule_ID); GM_unregisterMenuCommand(menu_feedBack_ID); @@ -42,16 +42,16 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status){ GM_setValue(`${Name}`, false); - GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3000}); }else{ GM_setValue(`${Name}`, true); - GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3000}); } registerMenuCommand(); // 重新注册脚本菜单 }; function addStyle() { - var style, + let style, style_1 = `.bml {display:none !important;}`, style_2 = ` a[href="connect.php?mod=config"], #toptb, #navmenu, #nv_ph, #nv, #pt .y, #chart, #ft, #custominfo_pmenu, .bm.lk, .dnch_eo_pt, .dnch_eo_pr, .dnch_eo_f, dl.pil.cl, td.plc.plm .sign, .dnch_eo_pb, .dnch_eo_pt, .pls .side-star, .pls .side-group, .res-footer-note, .comiis_nav, .scbar_hot_td, .md_ctrl, .pls.favatar .xg1 { @@ -125,6 +125,10 @@ textarea#fastpostmessage { border-top:0; border-bottom:0; background:0; +} +/* 链接点击后颜色变浅(灰白色) */ +.tl th a:visited, .tl td.fn a:visited { + color: #aaa; }`, style_Add = document.createElement('style'); if (menu_rule) { From c2caac0c6afdb7abbee56fa4fc22c54763358e1c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 14 Mar 2021 08:50:35 +0800 Subject: [PATCH 0114/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E8=AE=BA?= =?UTF-8?q?=E5=9D=9B=E6=81=A2=E5=A4=8D=E7=AD=BE=E5=88=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=87=AA=E5=8A=A8=E7=AD=BE=E5=88=B0=E6=9C=AA?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 6d44091a0..19968543c 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.3 +// @version 1.2.4 // @author X.I.U // @description 自动签到、自动无缝翻页(全站) // @match *://www.52pojie.cn/* @@ -179,7 +179,7 @@ // 自动签到 function qianDao() { let qiandao = document.querySelector('#um p:last-child a:first-child'); - if (qiandao && qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){ + if (qiandao && qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"){ window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] qiandao.href = "#" // 修改 URL 为 # From 319bf396a2b99239488fea525427369f588cddb2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 17 Mar 2021 07:11:07 +0800 Subject: [PATCH 0115/2377] README.md --- 3dm-Beautification.user.js | 2 +- README.md | 10 +++++----- Zhiyoo-Beautification.user.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/3dm-Beautification.user.js b/3dm-Beautification.user.js index f7a1f857b..520bd3b00 100644 --- a/3dm-Beautification.user.js +++ b/3dm-Beautification.user.js @@ -2,7 +2,7 @@ // @name 3DM论坛美化 // @version 1.0.0 // @author X.I.U -// @description 精简多余内容 +// @description 精简多余内容、样式优化 // @icon https://www.3dmgame.com/favicon.ico // @match *://bbs.3dmgame.com/* // @license GPL-3.0 License diff --git a/README.md b/README.md index c52e149ec..75157aac8 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,15 @@ | :----: | :---- | :---- | :----: | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot(原烈火汉化)、小众软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | -| [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | +| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot、小众软件、PubMed... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | -| [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | +| [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、样式优化、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 增强** | 自动签到、**自动回复**、自动无缝翻页、清理置顶帖子、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | -| [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | +| [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页** | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | | [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | diff --git a/Zhiyoo-Beautification.user.js b/Zhiyoo-Beautification.user.js index 472a86a3d..06a711afa 100644 --- a/Zhiyoo-Beautification.user.js +++ b/Zhiyoo-Beautification.user.js @@ -2,7 +2,7 @@ // @name 智友邦论坛美化 // @version 1.0.1 // @author X.I.U -// @description 精简多余内容、宽屏显示 +// @description 精简多余内容、样式优化、宽屏显示 // @icon http://bbs.zhiyoo.net/favicon.ico // @match *://bbs.zhiyoo.net/* // @license GPL-3.0 License From 305c264deb1391af15110d07beb963a429ad66fc Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 17 Mar 2021 08:22:51 +0800 Subject: [PATCH 0116/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=96=B0=E7=89=88=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=EF=BC=88Dark=20dimmed=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 009d02678..47ef4867f 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.3.9 +// @version 1.4.0 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -21,9 +21,14 @@ (function() { var backColor = '#ffffff'; var fontColor = '#888888'; - if('dark' == $('html').attr('data-color-mode')){ // 黑暗模式判断 - backColor = '#161a21'; - fontColor = '#b2b8bf'; + if($('html').attr('data-color-mode') == 'dark'){ // 黑暗模式判断 + if($('html').attr('data-dark-theme') == 'dark_dimmed'){ + backColor = '#272e37'; + fontColor = '#768390'; + }else{ + backColor = '#161a21'; + fontColor = '#b2b8bf'; + } } var download_url = [ ['https://gh.con.sh','美国'], From bdab5990c2827dfba8551f1e2e4eb9a311295067 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 20 Mar 2021 10:16:14 +0800 Subject: [PATCH 0117/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E5=9B=9E=E7=AD=94=EF=BC=88=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A9=BA=E7=99=BD=E5=A4=84=EF=BC=89]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 74 ++++++++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 17 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 22301e7ac..c84dbe500 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.5 +// @version 1.2.6 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 +// @description 移除登录弹窗、一键收起回答、收起当前回答(点击空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -19,12 +19,14 @@ // ==/UserScript== var menu_collapsedAnswer = GM_getValue('xiu2_menu_collapsedAnswer'), + menu_collapsedNowAnswer = GM_getValue('xiu2_menu_collapsedNowAnswer'), menu_publishTop = GM_getValue('xiu2_menu_publishTop'), menu_allTime = GM_getValue('xiu2_menu_allTime'), menu_typeTips = GM_getValue('xiu2_menu_typeTips'), menu_directLink = GM_getValue('xiu2_menu_directLink'), - menu_collapsedAnswer_ID, menu_publishTop_ID, menu_typeTips_ID, menu_allTime_ID, menu_directLink_ID, menu_feedBack_ID; + menu_collapsedAnswer_ID, menu_collapsedNowAnswer_ID, menu_publishTop_ID, menu_typeTips_ID, menu_allTime_ID, menu_directLink_ID, menu_feedBack_ID; if (menu_collapsedAnswer == null){menu_collapsedAnswer = true; GM_setValue('xiu2_menu_collapsedAnswer', menu_collapsedAnswer)}; +if (menu_collapsedNowAnswer == null){menu_collapsedNowAnswer = true; GM_setValue('xiu2_menu_collapsedNowAnswer', menu_collapsedNowAnswer)}; if (menu_publishTop == null){menu_publishTop = true; GM_setValue('xiu2_menu_publishTop', menu_publishTop)}; if (menu_typeTips == null){menu_typeTips = true; GM_setValue('xiu2_menu_typeTips', menu_typeTips)}; if (menu_allTime == null){menu_allTime = true; GM_setValue('xiu2_menu_allTime', menu_allTime)}; @@ -33,14 +35,16 @@ registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - var menu_collapsedAnswer_, menu_publishTop_, menu_typeTips_, menu_allTime_, menu_directLink_; + var menu_collapsedAnswer_, menu_collapsedNowAnswer_, menu_publishTop_, menu_typeTips_, menu_allTime_, menu_directLink_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_collapsedAnswer_ID); + GM_unregisterMenuCommand(menu_collapsedNowAnswer_ID); GM_unregisterMenuCommand(menu_publishTop_ID); GM_unregisterMenuCommand(menu_typeTips_ID); GM_unregisterMenuCommand(menu_directLink_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_collapsedAnswer = GM_getValue('xiu2_menu_collapsedAnswer'); + menu_collapsedNowAnswer = GM_getValue('xiu2_menu_collapsedNowAnswer'); menu_publishTop = GM_getValue('xiu2_menu_publishTop'); menu_allTime = GM_getValue('xiu2_menu_allTime'); menu_typeTips = GM_getValue('xiu2_menu_typeTips'); @@ -48,12 +52,14 @@ function registerMenuCommand() { } if (menu_collapsedAnswer){menu_collapsedAnswer_ = "√";}else{menu_collapsedAnswer_ = "×";} + if (menu_collapsedNowAnswer){menu_collapsedNowAnswer_ = "√";}else{menu_collapsedNowAnswer_ = "×";} if (menu_publishTop){menu_publishTop_ = "√";}else{menu_publishTop_ = "×";} if (menu_typeTips){menu_typeTips_ = "√";}else{menu_typeTips_ = "×";} if (menu_allTime){menu_allTime_ = "√";}else{menu_allTime_ = "×";} if (menu_directLink){menu_directLink_ = "√";}else{menu_directLink_ = "×";} menu_collapsedAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedAnswer_} ] 一键收起回答`, function(){menu_switch(menu_collapsedAnswer,'xiu2_menu_collapsedAnswer','一键收起回答')}); + menu_collapsedNowAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedNowAnswer_} ] 收起当前回答(点击空白处)`, function(){menu_switch(menu_collapsedNowAnswer,'xiu2_menu_collapsedNowAnswer','收起当前回答')}); menu_publishTop_ID = GM_registerMenuCommand(`[ ${menu_publishTop_} ] 置顶显示时间`, function(){menu_switch(menu_publishTop,'xiu2_menu_publishTop','置顶显示时间')}); menu_publishTop_ID = GM_registerMenuCommand(`[ ${menu_allTime_} ] 完整显示时间`, function(){menu_switch(menu_allTime,'xiu2_menu_allTime','完整显示时间')}); menu_typeTips_ID = GM_registerMenuCommand(`[ ${menu_typeTips_} ] 区分问题文章`, function(){menu_switch(menu_typeTips,'xiu2_menu_typeTips','区分问题文章')}); @@ -294,7 +300,7 @@ function directLink () { else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { external_href = $(this).attr("href"); new_href = external_href.substring(external_href = $(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); - console.log(`${new_href}`) + //console.log(`${new_href}`) $(this).attr("href", decodeURIComponent(new_href)); } else { @@ -360,8 +366,8 @@ function originalPic(){ // 一键收起回答 function collapsedAnswer(){ if(menu_collapsedAnswer){ - var button_Add = `` - var style_Add = document.createElement('style'); + let button_Add = `` + let style_Add = document.createElement('style'); style_Add.innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; document.head.appendChild(style_Add); $(".CornerAnimayedFlex").prepend(button_Add); @@ -375,21 +381,43 @@ function collapsedAnswer(){ } } +// 收起当前回答(收起回答) +function collapsedNowAnswer_2(){ + let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') + if(rightButton) { + rightButton = rightButton.querySelector('.ContentItem-rightButton') + if(rightButton && rightButton.attributes[0].name === "data-zop-retract-question") { + rightButton.click(); + } + } +} + +// 收起当前回答(监听点击事件) +function collapsedNowAnswer(selectors){ + if(menu_collapsedNowAnswer){ + document.querySelector(selectors).onclick = function(event){ + if (event.target==this) { + collapsedNowAnswer_2(); + } + } + } +} + var postNum; // 区分问题文章 function addTypeTips() { if(menu_typeTips){ // URL 匹配正则表达式 - var patt_zhuanlan = /zhuanlan.zhihu.com/, + let patt_zhuanlan = /zhuanlan.zhihu.com/, patt_question = /question\/\d+/, patt_question_answer = /answer\/\d+/, patt_video = /\/zvideo\//, patt_tip = /zhihu_e_tips/ - var postList = document.querySelectorAll('h2.ContentItem-title a'); + let postList = document.querySelectorAll('h2.ContentItem-title a'); postNum = document.querySelectorAll('small.zhihu_e_tips'); //console.log(`${postList.length} ${postNum.length}`) if (postList.length > postNum.length){ - for(var num = postNum.length;num文章 ` + postList[num].innerHTML @@ -477,36 +505,48 @@ function EventXMLHttpRequest() { } }) + setInterval(originalPic,100); // 默认高清原图 if(menu_directLink) setInterval(directLink, 100); // 默认站外直链 - // 每个页面对应的功能函数 - if(window.location.href.indexOf("question") > -1){ // 回答页 // + + if(window.location.href.indexOf("question") > -1){ // 回答页 // if(window.location.href.indexOf("waiting") == -1){ collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer(".QuestionPage"); + collapsedNowAnswer(".Question-main"); } setInterval(topTime_question, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("search") > -1){ // 搜索结果页 // + }else if(window.location.href.indexOf("search") > -1){ // 搜索结果页 // collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main div"); + collapsedNowAnswer(".Search-container"); setInterval(topTime_search, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 - }else if(window.location.href.indexOf("topic") > -1){ // 话题页 // + }else if(window.location.href.indexOf("topic") > -1){ // 话题页 // if(window.location.href.indexOf("unanswered") == -1){ collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main.App-main"); + collapsedNowAnswer(".ContentLayout"); setInterval(topTime_search, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 } - }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // + }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // removeLogin(); // 移除登录弹窗 setInterval(topTime_zhuanlan, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("column") > -1){ // 专栏 // + }else if(window.location.href.indexOf("column") > -1){ // 专栏 // collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main div"); setInterval(topTime_zhuanlan, 300); // 置顶显示时间 }else if(window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1){ // 用户主页 // collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main div"); + collapsedNowAnswer(".Profile-main"); setInterval(topTime_people, 300); // 置顶显示时间 - }else{ // 首页 // + }else{ // 首页 // collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main div"); + collapsedNowAnswer(".Topstory-container"); setInterval(topTime_index, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 } From 5c9b796634ec2e0afdb2e25977b63c083c5b772b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Mar 2021 16:18:21 +0800 Subject: [PATCH 0118/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=AE=BD?= =?UTF-8?q?=E5=B1=8F=E6=98=BE=E7=A4=BA]=20=E8=84=9A=E6=9C=AC=E8=8F=9C?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index eedb6d201..6438aab16 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -18,28 +18,34 @@ // ==/UserScript== (function() { - var menu_postimg = GM_getValue('xiu2_menu_postimg'), + var menu_widescreenDisplay = GM_getValue('xiu2_menu_widescreenDisplay'), + menu_postimg = GM_getValue('xiu2_menu_postimg'), menu_hideTitle = GM_getValue('xiu2_menu_hideTitle'), - menu_postimg_ID, menu_hideTitle_ID, menu_feedBack_ID; - if (menu_postimg == null){menu_postimg = false; GM_setValue('xiu2_menu_postimg', menu_postimg)}; - if (menu_hideTitle == null){menu_hideTitle = false; GM_setValue('xiu2_menu_hideTitle', menu_hideTitle)}; + menu_widescreenDisplay_ID, menu_postimg_ID, menu_hideTitle_ID, menu_feedBack_ID; + if (menu_widescreenDisplay == null){menu_widescreenDisplay = true; GM_setValue('xiu2_menu_widescreenDisplay', menu_widescreenDisplay)}; + if (menu_postimg == null){menu_postimg = true; GM_setValue('xiu2_menu_postimg', menu_postimg)}; + if (menu_hideTitle == null){menu_hideTitle = true; GM_setValue('xiu2_menu_hideTitle', menu_hideTitle)}; registerMenuCommand(); addStyle(); // 注册脚本菜单 function registerMenuCommand() { - let menu_postimg_, menu_hideTitle_; + let menu_widescreenDisplay_, menu_postimg_, menu_hideTitle_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 + GM_unregisterMenuCommand(menu_widescreenDisplay_ID); GM_unregisterMenuCommand(menu_postimg_ID); GM_unregisterMenuCommand(menu_hideTitle_ID); GM_unregisterMenuCommand(menu_feedBack_ID); + menu_widescreenDisplay = GM_getValue('xiu2_menu_widescreenDisplay'); menu_postimg = GM_getValue('xiu2_menu_postimg'); menu_hideTitle = GM_getValue('xiu2_menu_hideTitle'); } + if (menu_widescreenDisplay){menu_widescreenDisplay_ = "√";}else{menu_widescreenDisplay_ = "×";} if (menu_postimg){menu_postimg_ = "√";}else{menu_postimg_ = "×";} if (menu_hideTitle){menu_hideTitle_ = "√";}else{menu_hideTitle_ = "×";} + menu_widescreenDisplay_ID = GM_registerMenuCommand(`[ ${menu_widescreenDisplay_} ] 宽屏显示`, function(){menu_switch(menu_widescreenDisplay,'xiu2_menu_widescreenDisplay','宽屏显示')}); menu_postimg_ID = GM_registerMenuCommand(`[ ${menu_postimg_} ] 隐藏文章开头大图`, function(){menu_switch(menu_postimg,'xiu2_menu_postimg','隐藏文章开头大图')}); menu_hideTitle_ID = GM_registerMenuCommand(`[ ${menu_hideTitle_} ] 隐藏浏览回答标题`, function(){menu_switch(menu_hideTitle,'xiu2_menu_hideTitle','隐藏浏览回答标题')}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); @@ -60,8 +66,8 @@ // 添加样式 function addStyle() { - let style, - style_1 = ` + let style = ``, + style_1 = `/* 宽屏显示 */ .GlobalSideBar,.Question-sideColumn,.ContentLayout-sideColumn,.SearchSideBar,.Card.QuestionHeaderTopicMeta { display: none !important; } @@ -78,7 +84,8 @@ style_2 = `/* 隐藏在各列表中查看文章时开头显示的大图,不影响文章、专栏页面 */ .RichContent img.ArticleItem-image { display: none !important; -}`, +} +`, style_3 = `/* 调整文章编辑页面与实际文章宽度一致 */ .PostEditor .RichText { min-width: 690px !important; @@ -87,14 +94,18 @@ .WriteIndex-titleInput .Input { min-width: 690px !important; font-size: 24px; -}`, +} +`, style_4 = `/* 浏览回答时,向下翻隐藏顶栏(问题的标题)*/ header.is-hidden { display: none; -}` +} +` let style_Add = document.createElement('style'); // 宽屏显示 - style = style_1; + if (menu_widescreenDisplay) { + style += style_1; + } // 隐藏文章开头大图 if (menu_postimg) { style += style_2; From 069457ddd0ff8f53b03c7b3267d54e13cd9a074e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:48:55 +0800 Subject: [PATCH 0119/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E6=98=BE=E7=A4=BA=E6=97=B6=E9=97=B4]=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=8F=9C=E5=8D=95=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index c84dbe500..93815b98d 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.6 +// @version 1.2.7 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、收起当前回答(点击空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 +// @description 移除登录弹窗、一键收起回答、收起当前回答(点击两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -28,8 +28,8 @@ var menu_collapsedAnswer = GM_getValue('xiu2_menu_collapsedAnswer'), if (menu_collapsedAnswer == null){menu_collapsedAnswer = true; GM_setValue('xiu2_menu_collapsedAnswer', menu_collapsedAnswer)}; if (menu_collapsedNowAnswer == null){menu_collapsedNowAnswer = true; GM_setValue('xiu2_menu_collapsedNowAnswer', menu_collapsedNowAnswer)}; if (menu_publishTop == null){menu_publishTop = true; GM_setValue('xiu2_menu_publishTop', menu_publishTop)}; -if (menu_typeTips == null){menu_typeTips = true; GM_setValue('xiu2_menu_typeTips', menu_typeTips)}; if (menu_allTime == null){menu_allTime = true; GM_setValue('xiu2_menu_allTime', menu_allTime)}; +if (menu_typeTips == null){menu_typeTips = true; GM_setValue('xiu2_menu_typeTips', menu_typeTips)}; if (menu_directLink == null){menu_directLink = true; GM_setValue('xiu2_menu_directLink', menu_directLink)}; registerMenuCommand(); @@ -40,6 +40,7 @@ function registerMenuCommand() { GM_unregisterMenuCommand(menu_collapsedAnswer_ID); GM_unregisterMenuCommand(menu_collapsedNowAnswer_ID); GM_unregisterMenuCommand(menu_publishTop_ID); + GM_unregisterMenuCommand(menu_allTime_ID); GM_unregisterMenuCommand(menu_typeTips_ID); GM_unregisterMenuCommand(menu_directLink_ID); GM_unregisterMenuCommand(menu_feedBack_ID); @@ -54,14 +55,14 @@ function registerMenuCommand() { if (menu_collapsedAnswer){menu_collapsedAnswer_ = "√";}else{menu_collapsedAnswer_ = "×";} if (menu_collapsedNowAnswer){menu_collapsedNowAnswer_ = "√";}else{menu_collapsedNowAnswer_ = "×";} if (menu_publishTop){menu_publishTop_ = "√";}else{menu_publishTop_ = "×";} - if (menu_typeTips){menu_typeTips_ = "√";}else{menu_typeTips_ = "×";} if (menu_allTime){menu_allTime_ = "√";}else{menu_allTime_ = "×";} + if (menu_typeTips){menu_typeTips_ = "√";}else{menu_typeTips_ = "×";} if (menu_directLink){menu_directLink_ = "√";}else{menu_directLink_ = "×";} menu_collapsedAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedAnswer_} ] 一键收起回答`, function(){menu_switch(menu_collapsedAnswer,'xiu2_menu_collapsedAnswer','一键收起回答')}); - menu_collapsedNowAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedNowAnswer_} ] 收起当前回答(点击空白处)`, function(){menu_switch(menu_collapsedNowAnswer,'xiu2_menu_collapsedNowAnswer','收起当前回答')}); + menu_collapsedNowAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedNowAnswer_} ] 收起当前回答(点击两侧空白处)`, function(){menu_switch(menu_collapsedNowAnswer,'xiu2_menu_collapsedNowAnswer','收起当前回答')}); menu_publishTop_ID = GM_registerMenuCommand(`[ ${menu_publishTop_} ] 置顶显示时间`, function(){menu_switch(menu_publishTop,'xiu2_menu_publishTop','置顶显示时间')}); - menu_publishTop_ID = GM_registerMenuCommand(`[ ${menu_allTime_} ] 完整显示时间`, function(){menu_switch(menu_allTime,'xiu2_menu_allTime','完整显示时间')}); + menu_allTime_ID = GM_registerMenuCommand(`[ ${menu_allTime_} ] 完整显示时间`, function(){menu_switch(menu_allTime,'xiu2_menu_allTime','完整显示时间')}); menu_typeTips_ID = GM_registerMenuCommand(`[ ${menu_typeTips_} ] 区分问题文章`, function(){menu_switch(menu_typeTips,'xiu2_menu_typeTips','区分问题文章')}); menu_directLink_ID = GM_registerMenuCommand(`[ ${menu_directLink_} ] 默认站外直链`, function(){menu_switch(menu_directLink,'xiu2_menu_directLink','默认站外直链')}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); From f1479d304176d006ad1229b2f371ca49ff269347 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Mar 2021 21:00:56 +0800 Subject: [PATCH 0120/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=9B=BE=E7=89=87=E6=9C=80=E5=A4=A7=E9=AB=98=E5=BA=A6?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- Zhihu-Beautification.user.js | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 75157aac8..72adaf809 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、隐藏文章开头大图、文章编辑页与实际宽度一致... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、隐藏文章开头大图、调整图片最大高度、隐藏浏览... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot、小众软件、PubMed... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 6438aab16..d28a98ae1 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.0.7 +// @version 1.0.8 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、文章编辑页面与实际文章宽度一致、浏览回答向下翻时自动隐藏标题 +// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、浏览回答向下翻时自动隐藏标题、文章编辑页面与实际文章宽度一致 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -19,10 +19,12 @@ (function() { var menu_widescreenDisplay = GM_getValue('xiu2_menu_widescreenDisplay'), + menu_picHeight = GM_getValue('xiu2_menu_picHeight'), menu_postimg = GM_getValue('xiu2_menu_postimg'), menu_hideTitle = GM_getValue('xiu2_menu_hideTitle'), - menu_widescreenDisplay_ID, menu_postimg_ID, menu_hideTitle_ID, menu_feedBack_ID; + menu_widescreenDisplay_ID, menu_picHeight_ID, menu_postimg_ID, menu_hideTitle_ID, menu_feedBack_ID; if (menu_widescreenDisplay == null){menu_widescreenDisplay = true; GM_setValue('xiu2_menu_widescreenDisplay', menu_widescreenDisplay)}; + if (menu_picHeight == null){menu_picHeight = true; GM_setValue('xiu2_menu_picHeight', menu_picHeight)}; if (menu_postimg == null){menu_postimg = true; GM_setValue('xiu2_menu_postimg', menu_postimg)}; if (menu_hideTitle == null){menu_hideTitle = true; GM_setValue('xiu2_menu_hideTitle', menu_hideTitle)}; registerMenuCommand(); @@ -30,22 +32,26 @@ // 注册脚本菜单 function registerMenuCommand() { - let menu_widescreenDisplay_, menu_postimg_, menu_hideTitle_; + let menu_widescreenDisplay_, menu_picHeight_, menu_postimg_, menu_hideTitle_; if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_widescreenDisplay_ID); + GM_unregisterMenuCommand(menu_picHeight_ID); GM_unregisterMenuCommand(menu_postimg_ID); GM_unregisterMenuCommand(menu_hideTitle_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_widescreenDisplay = GM_getValue('xiu2_menu_widescreenDisplay'); + menu_picHeight = GM_getValue('xiu2_menu_picHeight'); menu_postimg = GM_getValue('xiu2_menu_postimg'); menu_hideTitle = GM_getValue('xiu2_menu_hideTitle'); } if (menu_widescreenDisplay){menu_widescreenDisplay_ = "√";}else{menu_widescreenDisplay_ = "×";} + if (menu_picHeight){menu_picHeight_ = "√";}else{menu_picHeight_ = "×";} if (menu_postimg){menu_postimg_ = "√";}else{menu_postimg_ = "×";} if (menu_hideTitle){menu_hideTitle_ = "√";}else{menu_hideTitle_ = "×";} menu_widescreenDisplay_ID = GM_registerMenuCommand(`[ ${menu_widescreenDisplay_} ] 宽屏显示`, function(){menu_switch(menu_widescreenDisplay,'xiu2_menu_widescreenDisplay','宽屏显示')}); + menu_picHeight_ID = GM_registerMenuCommand(`[ ${menu_picHeight_} ] 调整图片最大高度`, function(){menu_switch(menu_picHeight,'xiu2_menu_picHeight','调整图片最大高度')}); menu_postimg_ID = GM_registerMenuCommand(`[ ${menu_postimg_} ] 隐藏文章开头大图`, function(){menu_switch(menu_postimg,'xiu2_menu_postimg','隐藏文章开头大图')}); menu_hideTitle_ID = GM_registerMenuCommand(`[ ${menu_hideTitle_} ] 隐藏浏览回答标题`, function(){menu_switch(menu_hideTitle,'xiu2_menu_hideTitle','隐藏浏览回答标题')}); menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); @@ -98,7 +104,13 @@ `, style_4 = `/* 浏览回答时,向下翻隐藏顶栏(问题的标题)*/ header.is-hidden { -display: none; + display: none; +} +`, + style_5 = `/* 调整图片最大高度 */ +.ztext .content_image, .ztext .origin_image, .GifPlayer img { + max-height: 500px; + width: auto; } ` let style_Add = document.createElement('style'); @@ -106,6 +118,10 @@ display: none; if (menu_widescreenDisplay) { style += style_1; } + // 调整图片最大高度 + if (menu_picHeight) { + style += style_5; + } // 隐藏文章开头大图 if (menu_postimg) { style += style_2; From be2fcff611a0c8f2541700e2ad9084bfcea9b348 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 23 Mar 2021 21:02:32 +0800 Subject: [PATCH 0121/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=9B=BE=E7=89=87=E6=9C=80=E5=A4=A7=E9=AB=98=E5=BA=A6?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index d28a98ae1..e319e2d8d 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.0.8 +// @version 1.0.9 // @author X.I.U // @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、浏览回答向下翻时自动隐藏标题、文章编辑页面与实际文章宽度一致 // @match *://www.zhihu.com/* From 0b58c5ccacfcde686eec7ec2269e402e796694c9 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 25 Mar 2021 07:32:17 +0800 Subject: [PATCH 0122/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E7=99=BB=E5=BD=95=E6=8F=90=E7=A4=BA]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88=E9=BB=98=E8=AE=A4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index e319e2d8d..3195da7fa 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.0.9 +// @version 1.1.0 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、浏览回答向下翻时自动隐藏标题、文章编辑页面与实际文章宽度一致 +// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、浏览回答向下翻时自动隐藏标题、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -72,7 +72,8 @@ // 添加样式 function addStyle() { - let style = ``, + let style = `/* 屏蔽登录提示 */ +.Question-mainColumnLogin {display: none;}`, style_1 = `/* 宽屏显示 */ .GlobalSideBar,.Question-sideColumn,.ContentLayout-sideColumn,.SearchSideBar,.Card.QuestionHeaderTopicMeta { display: none !important; From da9f74b35a9b0c595c0542351822c604672e1623 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 26 Mar 2021 11:18:07 +0800 Subject: [PATCH 0123/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E4=B8=89?= =?UTF-8?q?=E5=9B=BD=E6=9D=80=E8=AE=BA=E5=9D=9B]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 81 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 19 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 33be28646..371d83b18 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.3 +// @version 1.1.4 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化)、小众软件、PubMed +// @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化)、小众软件、PubMed、三国杀论坛 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -11,6 +11,7 @@ // @match *://www.appinn.com/*/*/ // @match *://www.appinn.com/?s=* // @match *://pubmed.ncbi.nlm.nih.gov/?term=* +// @match *://club.sanguosha.com/* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -27,9 +28,9 @@ // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; - // 自动翻页规则 + // 自动翻页规则,HT_insert:1 = 插入元素前面;2 = 插入元素中的最后一个子元素后面 let DBSite = { - postslist_423down: { + _423down_postslist: { SiteTypeID: 1, pager: { type: 1, @@ -40,7 +41,7 @@ scrollDelta: 1500 } }, - postslist_apphot: { + apphot_postslist: { SiteTypeID: 2, pager: { type: 1, @@ -51,7 +52,7 @@ scrollDelta: 1500 } }, - postslist_appinn: { + appinn_postslist: { SiteTypeID: 3, pager: { type: 1, @@ -62,36 +63,69 @@ scrollDelta: 1500 } }, - postslist_pubmed: { + pubmed_postslist: { SiteTypeID: 4, pager: { type: 2, nextLink: 'button.load-button.next-page', scrollDelta: 1500 } + }, + sanguosha_forum: { + SiteTypeID: 5, + pager: { + type: 2, + nextLink: 'a.bm_h', + scrollDelta: 800 + } + }, + sanguosha_thread: { + SiteTypeID: 6, + pager: { + type: 1, + nextLink: '//a[@class="nxt"][@href]', + pageElement: 'css;div#postlist > div[id^="post_"]', + HT_insert: ['css;div#postlist', 2], + replaceE: 'css;div.pg', + scrollDelta: 800 + } + }, + sanguosha_search: { + SiteTypeID: 7, + pager: { + type: 1, + nextLink: '//a[@class="nxt"][@href]', + pageElement: 'css;div#threadlist > ul', + HT_insert: ['css;div#threadlist', 2], + replaceE: 'css;div.pg', + scrollDelta: 800 + } } }; - // 用于脚本内部判断当前 URL 类型 - let SiteType = { - POSTSLIST_423DOWN: DBSite.postslist_423down.SiteTypeID, - POSTSLIST_APPHOT: DBSite.postslist_apphot.SiteTypeID, - POSTSLIST_APPINN: DBSite.postslist_appinn.SiteTypeID, - POSTSLIST_PUBMED: DBSite.postslist_pubmed.SiteTypeID - }; switch (location.host) { case "www.423down.com": - curSite = DBSite.postslist_423down; + curSite = DBSite._423down_postslist; break; case "apphot.cc": - curSite = DBSite.postslist_apphot; + curSite = DBSite.apphot_postslist; break; case "www.appinn.com": - curSite = DBSite.postslist_appinn; + curSite = DBSite.appinn_postslist; break; case "pubmed.ncbi.nlm.nih.gov": - curSite = DBSite.postslist_pubmed; + curSite = DBSite.pubmed_postslist; + break; + case "club.sanguosha.com": + if(location.pathname.indexOf("forum") > -1){ // 各版块帖子列表 + curSite = DBSite.sanguosha_forum; + }else if(location.pathname.indexOf("thread") > -1){ // 帖子内 + curSite = DBSite.sanguosha_thread; + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + }else if(location.pathname.indexOf("search") > -1){ // 搜索结果 + curSite = DBSite.sanguosha_search; + } break; } curSite.pageUrl = ""; // 下一页URL @@ -122,6 +156,14 @@ } + // 隐藏帖子内的 [下一页] 按钮 + function hidePgbtn(){ + let style_hidePgbtn = document.createElement('style'); + style_hidePgbtn.innerHTML = `.pgbtn {display: none;}`; + document.head.appendChild(style_hidePgbtn); + } + + // 滚动条事件 function windowScroll(fn1) { var beforeScrollTop = document.documentElement.scrollTop, @@ -179,7 +221,7 @@ if (curSite.pager) { let curPageEle = getElementByXpath(curSite.pager.nextLink); var url = this.getFullHref(curPageEle); - //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); if(url === '') return; if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 curSite.pageUrl = url; @@ -191,6 +233,7 @@ timeout: 5000, onload: function (response) { try { + //console.log(`${response.responseText}`) var newBody = ShowPager.createDocumentByString(response.responseText); let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; From 1c4740aa5d41578578f20c0bbf4e438e329bbf62 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 27 Mar 2021 13:00:05 +0800 Subject: [PATCH 0124/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E8=AF=84=E8=AE=BA]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88=E7=82=B9=E5=87=BB=E7=BD=91=E9=A1=B5=E4=B8=A4?= =?UTF-8?q?=E4=BE=A7=E7=A9=BA=E7=99=BD=E5=A4=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 68 +++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 93815b98d..295d6c43d 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.7 +// @version 1.2.8 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、收起当前回答(点击两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 +// @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -382,28 +382,30 @@ function collapsedAnswer(){ } } -// 收起当前回答(收起回答) -function collapsedNowAnswer_2(){ - let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') - if(rightButton) { - rightButton = rightButton.querySelector('.ContentItem-rightButton') - if(rightButton && rightButton.attributes[0].name === "data-zop-retract-question") { - rightButton.click(); - } - } -} -// 收起当前回答(监听点击事件) +// 收起当前回答(监听点击事件,点击网页两侧空白处) function collapsedNowAnswer(selectors){ if(menu_collapsedNowAnswer){ document.querySelector(selectors).onclick = function(event){ if (event.target==this) { - collapsedNowAnswer_2(); + let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') + if(rightButton) { + rightButton = rightButton.querySelector('.ContentItem-rightButton') + if(rightButton && rightButton.attributes[0].name === "data-zop-retract-question") { + rightButton.click(); + } + } + + let commentCollapseButton = document.querySelector('.CommentCollapseButton') + if(commentCollapseButton) { + commentCollapseButton.click(); + } } } } } + var postNum; // 区分问题文章 function addTypeTips() { @@ -438,17 +440,40 @@ function addTypeTips() { } } -// 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126 -function removeLogin() { +// 监听 网页插入元素 事件 +function addEventListener_DOMNodeInserted() { + // 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126 let removeLoginModal = e => { - if (e.target.getElementsByClassName('Modal-wrapper').length > 0) { + if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper').length > 0) { if (e.target.getElementsByClassName('Modal-wrapper')[0].querySelector('.signFlowModal')){ e.target.getElementsByClassName('Modal-wrapper')[0].remove(); } setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); } } - document.addEventListener('DOMNodeInserted', removeLoginModal); + + // 收起当前评论(监听点击事件,点击网页两侧空白处) + let collapseNowComment = e => { + if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper Modal-enter').length > 0) { + document.getElementsByClassName('Modal-backdrop')[0].onclick = function(event){ + if (event.target==this) { + let closeButton = document.getElementsByClassName('Modal-closeButton')[0] + if(closeButton) { + closeButton.click(); + } + } + } + } + } + + if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 + document.addEventListener('DOMNodeInserted', removeLoginModal); + document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录]按钮跳转至登录页面 + document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎]按钮跳转至注册页面(实际上是同一个页面) + } else if(window.location.href.indexOf("zhuanlan") > -1){ + document.addEventListener('DOMNodeInserted', removeLoginModal); + } + document.addEventListener('DOMNodeInserted', collapseNowComment); // 收起当前评论(监听点击事件,点击网页两侧空白处) } @@ -473,11 +498,7 @@ function EventXMLHttpRequest() { })(XMLHttpRequest.prototype.open);*/ (function() { - if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 - removeLogin(); - document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录]按钮跳转至登录页面 - document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎]按钮跳转至注册页面(实际上是同一个页面) - } + addEventListener_DOMNodeInserted(); // 监听 网页插入元素 事件 // 默认折叠邀请,来自:https://greasyfork.org/scripts/402808 @@ -533,7 +554,6 @@ function EventXMLHttpRequest() { EventXMLHttpRequest(); // 区分问题文章 } }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // - removeLogin(); // 移除登录弹窗 setInterval(topTime_zhuanlan, 300); // 置顶显示时间 }else if(window.location.href.indexOf("column") > -1){ // 专栏 // collapsedAnswer(); // 一键收起回答 From ef9437c3ae7750016c11a7fd5afcdead705fec7c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 27 Mar 2021 13:01:50 +0800 Subject: [PATCH 0125/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E8=AF=84=E8=AE=BA]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88=E7=82=B9=E5=87=BB=E7=BD=91=E9=A1=B5=E4=B8=A4?= =?UTF-8?q?=E4=BE=A7=E7=A9=BA=E7=99=BD=E5=A4=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 295d6c43d..0e213066b 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -60,7 +60,7 @@ function registerMenuCommand() { if (menu_directLink){menu_directLink_ = "√";}else{menu_directLink_ = "×";} menu_collapsedAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedAnswer_} ] 一键收起回答`, function(){menu_switch(menu_collapsedAnswer,'xiu2_menu_collapsedAnswer','一键收起回答')}); - menu_collapsedNowAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedNowAnswer_} ] 收起当前回答(点击两侧空白处)`, function(){menu_switch(menu_collapsedNowAnswer,'xiu2_menu_collapsedNowAnswer','收起当前回答')}); + menu_collapsedNowAnswer_ID = GM_registerMenuCommand(`[ ${menu_collapsedNowAnswer_} ] 收起当前回答/评论(点击两侧空白处)`, function(){menu_switch(menu_collapsedNowAnswer,'xiu2_menu_collapsedNowAnswer','收起当前回答')}); menu_publishTop_ID = GM_registerMenuCommand(`[ ${menu_publishTop_} ] 置顶显示时间`, function(){menu_switch(menu_publishTop,'xiu2_menu_publishTop','置顶显示时间')}); menu_allTime_ID = GM_registerMenuCommand(`[ ${menu_allTime_} ] 完整显示时间`, function(){menu_switch(menu_allTime,'xiu2_menu_allTime','完整显示时间')}); menu_typeTips_ID = GM_registerMenuCommand(`[ ${menu_typeTips_} ] 区分问题文章`, function(){menu_switch(menu_typeTips,'xiu2_menu_typeTips','区分问题文章')}); From 20c7523a8d129f2a23bd27cd67a234743f5a1cc0 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 28 Mar 2021 16:24:37 +0800 Subject: [PATCH 0126/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E5=9B=9E=E7=AD=94=E6=97=B6=E4=B9=9F?= =?UTF-8?q?=E4=BC=9A=E6=94=B6=E8=B5=B7=E8=AF=84=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 0e213066b..85e32662d 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.8 +// @version 1.2.9 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -383,19 +383,25 @@ function collapsedAnswer(){ } -// 收起当前回答(监听点击事件,点击网页两侧空白处) +// 收起当前回答、评论(监听点击事件,点击网页两侧空白处) function collapsedNowAnswer(selectors){ if(menu_collapsedNowAnswer){ document.querySelector(selectors).onclick = function(event){ if (event.target==this) { let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') if(rightButton) { + // 先判断是否展开了评论(非评论弹窗) + let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click(); // 收起评论 + } rightButton = rightButton.querySelector('.ContentItem-rightButton') if(rightButton && rightButton.attributes[0].name === "data-zop-retract-question") { - rightButton.click(); + rightButton.click(); // 收起回答 } } + // 如果当前在看评论,则收起评论 let commentCollapseButton = document.querySelector('.CommentCollapseButton') if(commentCollapseButton) { commentCollapseButton.click(); From 8567a2ee6667dbf12a58cf625cc2b0728b434bea Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 28 Mar 2021 17:06:54 +0800 Subject: [PATCH 0127/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E5=9B=9E=E7=AD=94/=E8=AF=84?= =?UTF-8?q?=E8=AE=BA]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 85e32662d..9a85a4714 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.2.9 +// @version 1.3.0 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -389,8 +389,8 @@ function collapsedNowAnswer(selectors){ document.querySelector(selectors).onclick = function(event){ if (event.target==this) { let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') - if(rightButton) { - // 先判断是否展开了评论(非评论弹窗) + if(rightButton) { // 悬浮 [收起回答] + // 固定 [收起评论] let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { commentCollapseButton.click(); // 收起评论 @@ -399,12 +399,32 @@ function collapsedNowAnswer(selectors){ if(rightButton && rightButton.attributes[0].name === "data-zop-retract-question") { rightButton.click(); // 收起回答 } + }else{ // 固定 [收起回答] + document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { + if (el.attributes[0].name === "data-zop-retract-question") { + if (isElementInViewport(el)) { + let commentCollapseButton = document.querySelector('.ContentItem-rightButton').parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click(); // 收起评论 + } + el.click() + } + } + }) } - // 如果当前在看评论,则收起评论 + // 悬浮 [收起评论] let commentCollapseButton = document.querySelector('.CommentCollapseButton') if(commentCollapseButton) { commentCollapseButton.click(); + }else{ // 固定 [收起评论](针对短篇没有收起按钮的回答) + document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel').forEach(function (el) { + if (el.innerText.indexOf("收起评论") > -1) { + if (isElementInViewport(el)) { + el.click() + } + } + }) } } } @@ -412,6 +432,20 @@ function collapsedNowAnswer(selectors){ } +//获取元素是否在可视区域 +function isElementInViewport(el) { + let rect = el.getBoundingClientRect(); + return ( + rect.top >= 0 && + rect.left >= 0 && + rect.bottom <= + (window.innerHeight || document.documentElement.clientHeight) && + rect.right <= + (window.innerWidth || document.documentElement.clientWidth) + ); +} + + var postNum; // 区分问题文章 function addTypeTips() { From fd9bf9627949d957b89da0d517f732e5002563e7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 29 Mar 2021 00:54:21 +0800 Subject: [PATCH 0128/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E5=9B=9E=E7=AD=94/=E8=AF=84?= =?UTF-8?q?=E8=AE=BA]=20=E5=8A=9F=E8=83=BD=E5=9C=A8=E9=81=87=E5=88=B0?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E7=9A=84=20[=E6=94=B6=E8=B5=B7=E5=9B=9E?= =?UTF-8?q?=E7=AD=94]=20=E6=97=B6=EF=BC=8C=E5=8F=AF=E8=83=BD=E4=BC=9A?= =?UTF-8?q?=E6=94=B6=E8=B5=B7=E5=85=B6=E4=BB=96=E5=9B=9E=E7=AD=94=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 9a85a4714..513e4116f 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.0 +// @version 1.3.1 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -389,23 +389,25 @@ function collapsedNowAnswer(selectors){ document.querySelector(selectors).onclick = function(event){ if (event.target==this) { let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') - if(rightButton) { // 悬浮 [收起回答] - // 固定 [收起评论] + if(rightButton) { // 悬浮的 [收起回答] + // 固定的 [收起评论] let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click(); // 收起评论 + commentCollapseButton.click(); } + // 悬浮的 [收起回答] rightButton = rightButton.querySelector('.ContentItem-rightButton') if(rightButton && rightButton.attributes[0].name === "data-zop-retract-question") { - rightButton.click(); // 收起回答 + rightButton.click(); } - }else{ // 固定 [收起回答] + }else{ // 固定的 [收起回答] document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { if (el.attributes[0].name === "data-zop-retract-question") { if (isElementInViewport(el)) { - let commentCollapseButton = document.querySelector('.ContentItem-rightButton').parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + // 固定的 [收起评论] + let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click(); // 收起评论 + commentCollapseButton.click(); } el.click() } @@ -413,11 +415,11 @@ function collapsedNowAnswer(selectors){ }) } - // 悬浮 [收起评论] + // 悬浮的 [收起评论] let commentCollapseButton = document.querySelector('.CommentCollapseButton') if(commentCollapseButton) { commentCollapseButton.click(); - }else{ // 固定 [收起评论](针对短篇没有收起按钮的回答) + }else{ // 固定的 [收起评论](针对短篇没有收起按钮的回答) document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel').forEach(function (el) { if (el.innerText.indexOf("收起评论") > -1) { if (isElementInViewport(el)) { From ed40e10d72dbda8cea273b991d1f0c81c522b8fe Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 29 Mar 2021 18:32:12 +0800 Subject: [PATCH 0129/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 513e4116f..65387508b 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -374,7 +374,7 @@ function collapsedAnswer(){ $(".CornerAnimayedFlex").prepend(button_Add); $("#collapsed-button").on("click", function () { document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { - if (el.attributes[0].name === "data-zop-retract-question") { + if (el.hasAttribute('data-zop-retract-question')) { el.click() } }); @@ -397,12 +397,12 @@ function collapsedNowAnswer(selectors){ } // 悬浮的 [收起回答] rightButton = rightButton.querySelector('.ContentItem-rightButton') - if(rightButton && rightButton.attributes[0].name === "data-zop-retract-question") { + if(rightButton && rightButton.hasAttribute('data-zop-retract-question')) { rightButton.click(); } }else{ // 固定的 [收起回答] document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { - if (el.attributes[0].name === "data-zop-retract-question") { + if (el.hasAttribute('data-zop-retract-question')) { if (isElementInViewport(el)) { // 固定的 [收起评论] let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') From 6da818d9c5ecafc1b5252a77ac1cbc9ae1a7e6d4 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:39:04 +0800 Subject: [PATCH 0130/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 65387508b..b5a00c2bc 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -7,6 +7,7 @@ // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js +/* globals $ */ // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab From 13c92ffdf9b2fff377120eeb2351b11d2189dc0a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:40:32 +0800 Subject: [PATCH 0131/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Raw=20=E5=8D=95?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=BF=AB=E6=8D=B7=E4=B8=8B=E8=BD=BD=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?Github=20=E7=BD=91=E9=A1=B5=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 47ef4867f..6ff12c69b 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,12 +1,13 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.0 +// @version 1.4.1 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @match *://hub.fastgit.org/* // @icon https://i.loli.net/2021/03/07/oUHPFSOTjKnkMzJ.png // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js +/* globals $ */ // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab @@ -120,9 +121,9 @@ html = `
    `; for (let i=0;i${download_url[i][1]}` + html += `${download_url[i][1]}` } - html = html + `
    ` + html += `` $(this).next().after(html); }); // 修改[文件大小]元素样式 @@ -143,9 +144,9 @@ html = `
    `; for (let i=0;i${download_url[i][1]}` + html += `${download_url[i][1]}` } - html = html + `
    ` + html += `` $(this).after(html); }); }); @@ -169,7 +170,7 @@ html = ``; for (let i=0;i${svg[0]}Download ZIP ${download_url[i][1]}` + html += `
  • ${svg[0]}Download ZIP ${download_url[i][1]}
  • ` } $(this).after(html); }); @@ -188,7 +189,7 @@ html = ``; for (let i=0;i
    ${svg[1]}
    ` + html += `
    ${svg[1]}
    ` } $(this).after(html); }); @@ -209,7 +210,7 @@ html = ``; for (let i=0;i${raw_url[i+1][1]}` + html += `${raw_url[i+1][1]}` } $(this).after(html); }); @@ -228,7 +229,7 @@ var mouseOverHandler = function(evt){ let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), - aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.text-gray-light'); + aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); aElm_new.forEach(el=>el.style.cssText = 'display: inline'); aElm_now.forEach(el=>el.style.cssText = 'display: none'); }; @@ -237,7 +238,7 @@ var mouseOutHandler = function(evt){ let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), - aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.text-gray-light'); + aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); aElm_new.forEach(el=>el.style.cssText = 'display: none'); aElm_now.forEach(el=>el.style.cssText = 'display: inline'); }; @@ -246,10 +247,11 @@ files.each(function(i,fileElm){ let trElm = fileElm.parentNode.parentNode, cntElm_a = trElm.querySelector('.css-truncate.css-truncate-target.d-block.width-fit a'), - cntElm_svg = trElm.querySelector('.mr-3.flex-shrink-0 svg.octicon.octicon-file.text-gray-light'), + cntElm_svg = trElm.querySelector('.mr-3.flex-shrink-0 svg.octicon.octicon-file.color-icon-tertiary'), Name = cntElm_a.innerText, href = cntElm_a.attributes['href'].nodeValue.replace('https://github.com',''); let href2 = href.replace('/blob/','/'), url, url_name, url_tip = ''; + console.log(cntElm_a, cntElm_svg, Name, href) switch(menu_raw_fast) { case 2: From dc40d520d892fb4add3b8a18a53b3eb67931418f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 10:00:05 +0800 Subject: [PATCH 0132/2377] README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 72adaf809..2c980c49d 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ | :----: | :---- | :---- | :----: | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、隐藏文章开头大图、调整图片最大高度、隐藏浏览... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot、小众软件、PubMed... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot、小众软件、PubMed... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、样式优化、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | @@ -28,7 +28,7 @@ | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页** | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ From 209da344247c745d9ea9e2844e6fcf9530285abb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 10:25:49 +0800 Subject: [PATCH 0133/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=A7=84?= =?UTF-8?q?=E8=8C=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 16 ++++----- Zhihu-Enhanced.user.js | 38 ++++++++++------------ 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 6ff12c69b..0ee7c9fec 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -5,7 +5,7 @@ // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @match *://hub.fastgit.org/* -// @icon https://i.loli.net/2021/03/07/oUHPFSOTjKnkMzJ.png +// @icon https://i.loli.net/2021/03/30/ULV9XunaHesqGIR.png // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js /* globals $ */ // @grant GM_registerMenuCommand @@ -127,7 +127,7 @@ $(this).next().after(html); }); // 修改[文件大小]元素样式 - document.querySelectorAll('small.pl-2.color-text-secondary.flex-shrink-0').forEach(el=>el.style.cssText='display: flex; justify-content: flex-end; flex-grow: 1; margin-right: 8px;'); + document.querySelectorAll('small.pl-2.color-text-secondary.flex-shrink-0').forEach(el=>{el.style.cssText='display: flex; justify-content: flex-end; flex-grow: 1; margin-right: 8px;'}); // Source Code @@ -151,7 +151,7 @@ }); }); // 修改 Source code 样式,使其和加速按钮并列一排 - document.querySelectorAll('div.d-block.py-1.py-md-2.Box-body.px-2').forEach(el=>el.className='d-flex py-1 py-md-2 Box-body px-2'); + document.querySelectorAll('div.d-block.py-1.py-md-2.Box-body.px-2').forEach(el=>{el.className='d-flex py-1 py-md-2 Box-body px-2'}); } @@ -230,8 +230,8 @@ let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); - aElm_new.forEach(el=>el.style.cssText = 'display: inline'); - aElm_now.forEach(el=>el.style.cssText = 'display: none'); + aElm_new.forEach(el=>{el.style.cssText = 'display: inline'}); + aElm_now.forEach(el=>{el.style.cssText = 'display: none'}); }; // 鼠标离开则隐藏 @@ -239,8 +239,8 @@ let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); - aElm_new.forEach(el=>el.style.cssText = 'display: none'); - aElm_now.forEach(el=>el.style.cssText = 'display: inline'); + aElm_new.forEach(el=>{el.style.cssText = 'display: none'}); + aElm_now.forEach(el=>{el.style.cssText = 'display: inline'}); }; // 循环添加 @@ -249,7 +249,7 @@ cntElm_a = trElm.querySelector('.css-truncate.css-truncate-target.d-block.width-fit a'), cntElm_svg = trElm.querySelector('.mr-3.flex-shrink-0 svg.octicon.octicon-file.color-icon-tertiary'), Name = cntElm_a.innerText, - href = cntElm_a.attributes['href'].nodeValue.replace('https://github.com',''); + href = cntElm_a.attributes.href.nodeValue.replace('https://github.com',''); let href2 = href.replace('/blob/','/'), url, url_name, url_tip = ''; console.log(cntElm_a, cntElm_svg, Name, href) switch(menu_raw_fast) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index b5a00c2bc..53fb494a7 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -221,7 +221,7 @@ function topTime_search() // 完整显示时间 if(menu_allTime) { - if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时,增加具体发布时间data-tooltip + if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时,增加具体发布时间data-tooltip { let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); var oldtext =$(this).find(".ContentItem-time").find("span").text(); @@ -298,19 +298,18 @@ function directLink () { if ($(this).find("span").length > 0) { new_href = $(this).text(); $(this).attr("href", new_href); - } - else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { + } else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { external_href = $(this).attr("href"); new_href = external_href.substring(external_href = $(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); //console.log(`${new_href}`) $(this).attr("href", decodeURIComponent(new_href)); - } - else { + } else { external_href = $(this).attr("href"); - if (external_href.lastIndexOf("https%3A")) + if (external_href.lastIndexOf("https%3A")) { new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("https%3A")); - else if (external_href.lastIndexOf("http%3A%2F%2F")) + } else if (external_href.lastIndexOf("http%3A%2F%2F")) { new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("http%3A")); + } $(this).attr("href", decodeURIComponent(new_href)); } }); @@ -320,18 +319,17 @@ function directLink () { if ($(this).find("LinkCard-title").length > 0 && $(this).find("LinkCard-title").indexOf("http") > -1) { new_href = $(this).find("LinkCard-title").text(); $(this).attr("href", new_href); - } - else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { + } else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { external_href = $(this).attr("href"); new_href = external_href.substring(external_href = $(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); $(this).attr("href", decodeURIComponent(new_href)); - } - else { + } else { external_href = $(this).attr("href"); - if (external_href.lastIndexOf("https%3A")) + if (external_href.lastIndexOf("https%3A")) { new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("https%3A")); - else if (external_href.lastIndexOf("http%3A%2F%2F")) + } else if (external_href.lastIndexOf("http%3A%2F%2F")) { new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("http%3A")); + } $(this).attr("href", decodeURIComponent(new_href)); } }); @@ -356,10 +354,10 @@ function directLink () { // 默认高清原图,来自:https://greasyfork.org/scripts/402808 function originalPic(){ $("img").each(function(){ - if($(this).attr("data-original")!=undefined && !$(this).hasClass("comment_sticker")) - { - if($(this).attr("src") != $(this).attr("data-original")) + if ($(this).attr("data-original")!=undefined && !$(this).hasClass("comment_sticker")) { + if ($(this).attr("src") != $(this).attr("data-original")) { $(this).attr("src",$(this).attr("data-original")) + } } }) $(".Modal-inner").css({"overflow-y":"hidden"}) @@ -464,16 +462,16 @@ function addTypeTips() { //console.log(`${postList.length} ${postNum.length}`) if (postList.length > postNum.length){ for(let num = postNum.length;num文章 ` + postList[num].innerHTML - }else if (patt_question.test(postList[num].href)){ // 如果是问题 + }else if (patt_question.test(postList[num].href)){ // 如果是问题 if (patt_question_answer.test(postList[num].href)){ // 如果是指向回答的问题(而非指向纯问题的链接) postList[num].innerHTML = `问题 ` + postList[num].innerHTML }else{ postList[num].innerHTML = `问题 ` + postList[num].innerHTML } - }else if (patt_video.test(postList[num].href)){ // 如果是视频 + }else if (patt_video.test(postList[num].href)){ // 如果是视频 postList[num].innerHTML = `视频 ` + postList[num].innerHTML } //postNum += 1; From 8e75f916b1c0dc201c352da60fe01aa0c1ae908c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 10:45:50 +0800 Subject: [PATCH 0134/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=A7=84?= =?UTF-8?q?=E8=8C=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index fa029f8fb..60d9c0321 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -147,7 +147,7 @@ if(menu_thread_pageLoading)curSite = DBSite.thread; if(menu_autoReply)autoReply(); // 如果有隐藏内容,则自动回复 pageLoading(); // 自动翻页 - if(menu_scrollToShowhide)setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); // 滚动至隐藏内容 + if(menu_scrollToShowhide)setTimeout(function(){window.scrollTo(0,document.querySelector('.showhide').offsetTop)}, 500); // 滚动至隐藏内容 }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ // 各板块帖子列表 curSite = DBSite.forum; @@ -212,7 +212,7 @@ window.scrollTo(0,showhide.offsetTop) }}, 100) }else{ - setTimeout(`window.scrollTo(0,0)`, 1000); + setTimeout(function(){window.scrollTo(0,0)}, 1000); } } } From 255b6f00c0df2ece03f8ea847e84ffd3d9900771 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 10:47:12 +0800 Subject: [PATCH 0135/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=81=B6?= =?UTF-8?q?=E5=B0=94=E4=BC=9A=E6=97=A0=E6=B3=95=E6=BB=9A=E5=8A=A8=E5=88=B0?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=86=85=E5=AE=B9=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?;=E4=BC=98=E5=8C=96=20=E8=A7=84=E8=8C=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 5dfe12cac..573f7f572 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 智友邦论坛增强 -// @version 1.1.6 +// @version 1.1.7 // @author X.I.U // @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件兑换/下载、清理帖子标题〖XXX〗【XXX】文字 // @icon http://bbs.zhiyoo.net/favicon.ico @@ -210,9 +210,9 @@ writeReply(); // 如果使用了我的 [智友邦美化] 脚本,则定位至底部,反之定位至隐藏内容区域 if (document.getElementById("fastpostmessage").offsetParent == null){ - setTimeout(`window.scrollTo(0,99999999)`, 500); + setTimeout(function(){window.scrollTo(0,99999999)}, 1000); }else{ - setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); + setTimeout(function(){window.scrollTo(0,document.querySelector('.showhide').offsetTop)}, 1000); } } } @@ -226,9 +226,9 @@ // 随机写入回复内容 textarea.value = textarea.value + replyList[Math.floor((Math.random()*replyList.length))] + replyList[Math.floor((Math.random()*replyList.length))]; //console.log(`${textarea.value}`) - var fastpostsubmit = document.getElementById("fastpostsubmit"); + let fastpostsubmit = document.getElementById("fastpostsubmit"); if (fastpostsubmit){ - setTimeout(`fastpostsubmit.click()`, 200); + setTimeout(function(){fastpostsubmit.click()}, 200); } } } @@ -242,11 +242,9 @@ if (document.getElementsByClassName("showhide").length > 0){ // 如果使用了我的 [智友邦美化] 脚本,则定位至底部,反之定位至隐藏内容区域 if (document.getElementById("fastpostmessage").offsetParent == null){ - setTimeout(`window.scrollTo(0,99999999)`, 500); - console.log("111") + setTimeout(function(){window.scrollTo(0,99999999)}, 1000); }else{ - setTimeout(`window.scrollTo(0,document.querySelector('.showhide').offsetTop)`, 500); - console.log("222") + setTimeout(function(){window.scrollTo(0,document.querySelector('.showhide').offsetTop)}, 1000); } } } From 8f446b24ea64d7bbb03fa6941ff3890bfa696723 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 14:23:28 +0800 Subject: [PATCH 0136/2377] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81=EF=BC=88=E5=BF=98=E8=AE=B0=E5=88=A0?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E8=99=BD=E7=84=B6=E6=B2=A1=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Autopage.user.js b/Autopage.user.js index 371d83b18..e2e06bed5 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -221,7 +221,7 @@ if (curSite.pager) { let curPageEle = getElementByXpath(curSite.pager.nextLink); var url = this.getFullHref(curPageEle); - console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); if(url === '') return; if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 curSite.pageUrl = url; From 7211d402fd38887ab517355e8ef875cc241b11de Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 19:22:55 +0800 Subject: [PATCH 0137/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E5=9B=9E=E5=88=B0=E9=A1=B6=E9=83=A8](=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E4=B8=A4=E4=BE=A7=E7=A9=BA=E7=99=BD=E5=A4=84)=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD;=20=E4=BC=98=E5=8C=96=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 124 +++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 60 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 53fb494a7..6b5b2ce84 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.1 +// @version 1.3.2 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 +// @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -19,59 +19,37 @@ // @namespace https://greasyfork.org/scripts/412205 // ==/UserScript== -var menu_collapsedAnswer = GM_getValue('xiu2_menu_collapsedAnswer'), - menu_collapsedNowAnswer = GM_getValue('xiu2_menu_collapsedNowAnswer'), - menu_publishTop = GM_getValue('xiu2_menu_publishTop'), - menu_allTime = GM_getValue('xiu2_menu_allTime'), - menu_typeTips = GM_getValue('xiu2_menu_typeTips'), - menu_directLink = GM_getValue('xiu2_menu_directLink'), - menu_collapsedAnswer_ID, menu_collapsedNowAnswer_ID, menu_publishTop_ID, menu_typeTips_ID, menu_allTime_ID, menu_directLink_ID, menu_feedBack_ID; -if (menu_collapsedAnswer == null){menu_collapsedAnswer = true; GM_setValue('xiu2_menu_collapsedAnswer', menu_collapsedAnswer)}; -if (menu_collapsedNowAnswer == null){menu_collapsedNowAnswer = true; GM_setValue('xiu2_menu_collapsedNowAnswer', menu_collapsedNowAnswer)}; -if (menu_publishTop == null){menu_publishTop = true; GM_setValue('xiu2_menu_publishTop', menu_publishTop)}; -if (menu_allTime == null){menu_allTime = true; GM_setValue('xiu2_menu_allTime', menu_allTime)}; -if (menu_typeTips == null){menu_typeTips = true; GM_setValue('xiu2_menu_typeTips', menu_typeTips)}; -if (menu_directLink == null){menu_directLink = true; GM_setValue('xiu2_menu_directLink', menu_directLink)}; +var menu_ALL = [ + ['menu_collapsedAnswer', '一键收起回答', '一键收起回答', true], + ['menu_collapsedNowAnswer', '收起当前回答/评论(点击两侧空白处)', '收起当前回答/评论', true], + ['menu_backToTop', '快捷回到顶部(右键两侧空白处)', '快捷回到顶部', true], + ['menu_publishTop', '置顶显示时间', '置顶显示时间', true], + ['menu_allTime', '完整显示时间', '完整显示时间', true], + ['menu_typeTips', '区分问题文章', '区分问题文章', true], + ['menu_directLink', '默认站外直链', '默认站外直链', true] +], menu_ID = []; +for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i0 && $(this).find(".ContentItem-time").find("span").text() != null) { // 完整显示时间 - if(menu_allTime) + if(menu_value('menu_allTime')) { if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip { @@ -106,7 +94,7 @@ function topTime_index() } //发布时间置顶 - if(menu_publishTop) + if(menu_value('menu_publishTop')) { if(!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) { @@ -141,7 +129,7 @@ function topTime_question() if( !($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length>0 && $(this).find(".ContentItem-time").find("span").text() != null) { // 完整显示时间 - if(menu_allTime) + if(menu_value('menu_allTime')) { if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip { @@ -159,7 +147,7 @@ function topTime_question() } //发布时间置顶 - if(menu_publishTop) + if(menu_value('menu_publishTop')) { if(!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) { @@ -193,7 +181,7 @@ function topTime_zhuanlan() $(".Recommendations-Main").hide(); // 完整显示时间 - if(menu_allTime) + if(menu_value('menu_allTime')) { if( $(".ContentItem-time").text().indexOf("编辑于")>-1 && !$(".ContentItem-time").hasClass("done")) { @@ -205,7 +193,7 @@ function topTime_zhuanlan() } //发布时间置顶 - if(menu_publishTop && $(".Post-Header").find(".ContentItem-time").length==0) + if(menu_value('menu_publishTop') && $(".Post-Header").find(".ContentItem-time").length==0) { $(".ContentItem-time").css({"padding":"0px 0px 0px 0px","margin-top": "14px"}); $(".ContentItem-time").appendTo($(".Post-Header")) @@ -219,7 +207,7 @@ function topTime_search() if( !($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length>0 && $(this).find(".ContentItem-time").find("span").text() != null) { // 完整显示时间 - if(menu_allTime) + if(menu_value('menu_allTime')) { if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时,增加具体发布时间data-tooltip { @@ -237,7 +225,7 @@ function topTime_search() } //发布时间置顶 - if(menu_publishTop) + if(menu_value('menu_publishTop')) { if(!$(this).find(".ContentItem-time").parent().hasClass("SearchItem-meta")) { @@ -258,7 +246,7 @@ function topTime_people() if( !($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length>0 && $(this).find(".ContentItem-time").find("span").text() != null) { // 完整显示时间 - if(menu_allTime) + if(menu_value('menu_allTime')) { if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip { @@ -276,7 +264,7 @@ function topTime_people() } //发布时间置顶 - if(menu_publishTop) + if(menu_value('menu_publishTop')) { if(!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) { @@ -365,7 +353,7 @@ function originalPic(){ // 一键收起回答 function collapsedAnswer(){ - if(menu_collapsedAnswer){ + if(menu_value('menu_collapsedAnswer')){ let button_Add = `` let style_Add = document.createElement('style'); style_Add.innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; @@ -384,7 +372,8 @@ function collapsedAnswer(){ // 收起当前回答、评论(监听点击事件,点击网页两侧空白处) function collapsedNowAnswer(selectors){ - if(menu_collapsedNowAnswer){ + backToTop(selectors) + if(menu_value('menu_collapsedNowAnswer')){ document.querySelector(selectors).onclick = function(event){ if (event.target==this) { let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') @@ -433,6 +422,19 @@ function collapsedNowAnswer(selectors){ } +// 回到顶部(监听点击事件,鼠标右键点击网页两侧空白处) +function backToTop(selectors){ + if(menu_value('menu_backToTop')){ + document.querySelector(selectors).oncontextmenu = function(event){ + if (event.target==this) { + event.preventDefault(); + window.scrollTo(0,0) + } + } + } +} + + //获取元素是否在可视区域 function isElementInViewport(el) { let rect = el.getBoundingClientRect(); @@ -450,7 +452,7 @@ function isElementInViewport(el) { var postNum; // 区分问题文章 function addTypeTips() { - if(menu_typeTips){ + if(menu_value('menu_typeTips')){ // URL 匹配正则表达式 let patt_zhuanlan = /zhuanlan.zhihu.com/, patt_question = /question\/\d+/, @@ -570,7 +572,7 @@ function EventXMLHttpRequest() { setInterval(originalPic,100); // 默认高清原图 - if(menu_directLink) setInterval(directLink, 100); // 默认站外直链 + if(menu_value('menu_directLink')) setInterval(directLink, 100); // 默认站外直链 if(window.location.href.indexOf("question") > -1){ // 回答页 // @@ -595,6 +597,8 @@ function EventXMLHttpRequest() { EventXMLHttpRequest(); // 区分问题文章 } }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // + backToTop("article.Post-Main.Post-NormalMain") + backToTop("div.Post-Sub.Post-NormalSub") setInterval(topTime_zhuanlan, 300); // 置顶显示时间 }else if(window.location.href.indexOf("column") > -1){ // 专栏 // collapsedAnswer(); // 一键收起回答 From 5d857dcbca17a36916c54edc316448f221278c58 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 20:19:05 +0800 Subject: [PATCH 0138/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BD=BF=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98;?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=84=9A=E6=9C=AC=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 118 ++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index b360eba7c..2451c3ceb 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,9 +1,9 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.5 +// @version 1.0.6 // @author X.I.U -// @description 自动无缝翻页、自动显示帖子内被隐藏的回复 -// @match *://www.hostloc.com/* +// @description 自动无缝翻页、自动显示帖子内隐藏回复 +// @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -18,35 +18,32 @@ // ==/UserScript== (function() { - var menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'), - menu_showhide = GM_getValue('xiu2_menu_showhide'); - var menu_thread_pageLoading_ID, menu_showhide_ID, menu_feedBack_ID; - if (menu_thread_pageLoading == null){menu_thread_pageLoading = true; GM_setValue('xiu2_menu_thread_pageLoading', menu_thread_pageLoading)}; - if (menu_showhide == null){menu_showhide = true; GM_setValue('xiu2_menu_showhide', menu_showhide)}; + var menu_ALL = [ + ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], + ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true] + ], menu_ID = []; + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i Date: Tue, 30 Mar 2021 20:47:26 +0800 Subject: [PATCH 0139/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=8F=9C=E5=8D=95=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 71 ++++++++++++------------ 52pojie-Beautification.user.js | 50 ++++++++++------- 52pojie-Enhanced.user.js | 54 ++++++++++--------- Lanzou-Enhanced.user.js | 99 ++++++++++++++++------------------ Zhihu-Beautification.user.js | 75 +++++++++++++------------- Zhiyoo-Enhanced.user.js | 57 ++++++++++++-------- 6 files changed, 209 insertions(+), 197 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 60d9c0321..4c2ec5c3a 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -18,47 +18,34 @@ // ==/UserScript== (function() { - var menu_thread_pageLoading = GM_getValue('xiu2_menu_thread_pageLoading'), - menu_autoReply = GM_getValue('xiu2_menu_autoReply'), - menu_cleanTopPost = GM_getValue('xiu2_menu_cleanTopPost'), - menu_scrollToShowhide = GM_getValue('xiu2_menu_scrollToShowhide'); - var menu_thread_pageLoading_ID, menu_autoReply_ID, menu_cleanTopPost_ID, menu_scrollToShowhide_ID, menu_feedBack_ID; - if (menu_thread_pageLoading == null){menu_thread_pageLoading = false; GM_setValue('xiu2_menu_thread_pageLoading', menu_thread_pageLoading)}; - if (menu_autoReply == null){menu_autoReply = true; GM_setValue('xiu2_menu_autoReply', menu_autoReply)}; - if (menu_cleanTopPost == null){menu_cleanTopPost = true; GM_setValue('xiu2_menu_cleanTopPost', menu_cleanTopPost)}; - if (menu_scrollToShowhide == null){menu_scrollToShowhide = true; GM_setValue('xiu2_menu_scrollToShowhide', menu_scrollToShowhide)}; + var menu_ALL = [ + ['menu_thread_pageLoading', '自动回复', '自动回复', true], + ['menu_autoReply', '清理置顶帖子', '清理置顶帖子', true], + ['menu_cleanTopPost', '帖子内自动翻页', '帖子内自动翻页', true], + ['menu_scrollToShowhide', '自动滚动至隐藏内容', '自动滚动至隐藏内容', true] + ], menu_ID = []; + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i div.bm_c > table"), tbodys = table.getElementsByTagName('tbody'), arrs = []; diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 9d6192146..2c7a23278 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -28,68 +28,59 @@ // @namespace https://github.com/XIU2/UserScript // ==/UserScript== (function() { - var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha'), - menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha'), - menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection'), - menu_rightClickMenu = GM_getValue('xiu2_menu_rightClickMenu'), - menu_folderDescdesMenu = GM_getValue('xiu2_menu_folderDescdesMenu'); - var menu_open_fileSha_ID, menu_copy_fileSha_ID, menu_refreshCorrection_ID, menu_rightClickMenu_ID, menu_folderDescdesMenu_ID, menu_feedBack_ID, lastFolderID; - if (menu_open_fileSha == null){menu_open_fileSha = true; GM_setValue('xiu2_menu_open_fileSha', menu_open_fileSha)}; - if (menu_copy_fileSha == null){menu_copy_fileSha = true; GM_setValue('xiu2_menu_copy_fileSha', menu_copy_fileSha)}; - if (menu_refreshCorrection == null){menu_refreshCorrection = true; GM_setValue('xiu2_menu_refreshCorrection', menu_refreshCorrection)}; - if (menu_rightClickMenu == null){menu_rightClickMenu = true; GM_setValue('xiu2_menu_rightClickMenu', menu_rightClickMenu)}; - if (menu_folderDescdesMenu == null){menu_folderDescdesMenu = true; GM_setValue('xiu2_menu_folderDescdesMenu', menu_folderDescdesMenu)}; + var menu_ALL = [ + ['menu_open_fileSha', '自动打开分享链接', '自动打开分享链接', true], + ['menu_copy_fileSha', '自动复制分享链接', '自动复制分享链接', true], + ['menu_refreshCorrection', '刷新不返回根目录', '刷新不返回根目录', true], + ['menu_rightClickMenu', '右键文件显示菜单', '右键文件显示菜单', true], + ['menu_folderDescdesMenu', '调整描述(话说)编辑框大小', '调整描述(话说)编辑框大小', true] + ], menu_ID = [], lastFolderID; + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i 0){ for(let num = postNum;num Date: Tue, 30 Mar 2021 20:52:16 +0800 Subject: [PATCH 0140/2377] README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c980c49d..3f0e7c41c 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ | [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页** | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示帖子内被隐藏的回复 | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页**、屏蔽导读悬赏贴(最新发表) | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示隐藏回复(帖子内) | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ From 9c837248d6f751618e1b5e4aa74b6d955662a1e3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 21:40:03 +0800 Subject: [PATCH 0141/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E5=9B=9E=E7=AD=94/=E8=AF=84?= =?UTF-8?q?=E8=AE=BA]=20=E5=8A=9F=E8=83=BD=EF=BC=88=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E4=BA=86=E5=9C=A8=E6=97=A2=E7=9C=8B=E4=B8=8D=E5=88=B0=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E7=9A=84=20[=E6=94=B6=E8=B5=B7=E8=AF=84=E8=AE=BA]=20?= =?UTF-8?q?=E5=8F=88=E7=9C=8B=E4=B8=8D=E5=88=B0=E6=82=AC=E6=B5=AE=E7=9A=84?= =?UTF-8?q?=20[=E6=94=B6=E8=B5=B7=E8=AF=84=E8=AE=BA]=20=E6=97=B6=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=94=B6=E8=B5=B7=E8=AF=84=E8=AE=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98)=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 398 +++++++++++++++++++++-------------------- 1 file changed, 208 insertions(+), 190 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 6b5b2ce84..2a9e43193 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.2 +// @version 1.3.3 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -69,6 +69,212 @@ function menu_value(menuName) { } +// 一键收起回答 +function collapsedAnswer(){ + if(menu_value('menu_collapsedAnswer')){ + let button_Add = `` + let style_Add = document.createElement('style'); + style_Add.innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; + document.head.appendChild(style_Add); + $(".CornerAnimayedFlex").prepend(button_Add); + $("#collapsed-button").on("click", function () { + document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { + if (el.hasAttribute('data-zop-retract-question')) { + el.click() + } + }); + }) + } +} + + +// 收起当前回答、评论(监听点击事件,点击网页两侧空白处) +function collapsedNowAnswer(selectors){ + backToTop(selectors) + if(menu_value('menu_collapsedNowAnswer')){ + document.querySelector(selectors).onclick = function(event){ + if (event.target==this) { + let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') + if(rightButton) { // 悬浮的 [收起回答](此时正在浏览回答内容 [头部区域 + 中间区域]) + // 固定的 [收起评论](先看看是否展开评论) + let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click(); + } + // 再去收起回答 + rightButton = rightButton.querySelector('.ContentItem-rightButton') + if(rightButton && rightButton.hasAttribute('data-zop-retract-question')) { + rightButton.click(); + } + }else{ // 固定的 [收起回答](此时正在浏览回答内容 [尾部区域]) + for (let el of document.querySelectorAll('.ContentItem-rightButton')) { + if (el.hasAttribute('data-zop-retract-question')) { + if (isElementInViewport(el)) { + // 固定的 [收起评论](先看看是否展开评论) + let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click(); + } + el.click() // 再去收起回答 + break + } + } + } + } + + var commentCollapseButton_ = false; + // 悬浮的 [收起评论](此时正在浏览评论内容 [中间区域]) + let commentCollapseButton = document.querySelector('.CommentCollapseButton') + if(commentCollapseButton) { + commentCollapseButton.click(); + }else{ // 固定的 [收起评论](此时正在浏览评论内容 [头部区域]) + for (let el of document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel')) { + if (el.innerText.indexOf("收起评论") > -1) { + if (isElementInViewport(el)) { + el.click() + commentCollapseButton_ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 [收起评论] 时) + break + } + } + } + if(commentCollapseButton_ == false){ // 可视区域中没有 [收起评论] 时(此时正在浏览评论内容 [头部区域] + [尾部区域](不上不下的,既看不到固定的 [收起评论] 又看不到悬浮的 [收起评论])),需要判断可视区域中是否存在评论元素 + for (let el of document.querySelectorAll('.NestComment')) { + if (isElementInViewport(el)) { + let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if (commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click() + break + } + } + } + } + } + } + } + } +} + + +// 回到顶部(监听点击事件,鼠标右键点击网页两侧空白处) +function backToTop(selectors){ + if(menu_value('menu_backToTop')){ + document.querySelector(selectors).oncontextmenu = function(event){ + if (event.target==this) { + event.preventDefault(); + window.scrollTo(0,0) + } + } + } +} + + +//获取元素是否在可视区域 +function isElementInViewport(el) { + let rect = el.getBoundingClientRect(); + return ( + rect.top >= 0 && + rect.left >= 0 && + rect.bottom <= + (window.innerHeight || document.documentElement.clientHeight) && + rect.right <= + (window.innerWidth || document.documentElement.clientWidth) + ); +} + + +var postNum; +// 区分问题文章 +function addTypeTips() { + if(menu_value('menu_typeTips')){ + // URL 匹配正则表达式 + let patt_zhuanlan = /zhuanlan.zhihu.com/, + patt_question = /question\/\d+/, + patt_question_answer = /answer\/\d+/, + patt_video = /\/zvideo\//, + patt_tip = /zhihu_e_tips/ + let postList = document.querySelectorAll('h2.ContentItem-title a'); + postNum = document.querySelectorAll('small.zhihu_e_tips'); + //console.log(`${postList.length} ${postNum.length}`) + if (postList.length > postNum.length){ + for(let num = postNum.length;num文章 ` + postList[num].innerHTML + }else if (patt_question.test(postList[num].href)){ // 如果是问题 + if (patt_question_answer.test(postList[num].href)){ // 如果是指向回答的问题(而非指向纯问题的链接) + postList[num].innerHTML = `问题 ` + postList[num].innerHTML + }else{ + postList[num].innerHTML = `问题 ` + postList[num].innerHTML + } + }else if (patt_video.test(postList[num].href)){ // 如果是视频 + postList[num].innerHTML = `视频 ` + postList[num].innerHTML + } + //postNum += 1; + } + } + } + } +} + + +// 监听 网页插入元素 事件 +function addEventListener_DOMNodeInserted() { + // 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126 + let removeLoginModal = e => { + if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper').length > 0) { + if (e.target.getElementsByClassName('Modal-wrapper')[0].querySelector('.signFlowModal')){ + e.target.getElementsByClassName('Modal-wrapper')[0].remove(); + } + setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); + } + } + + // 收起当前评论(监听点击事件,点击网页两侧空白处) + let collapseNowComment = e => { + if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper Modal-enter').length > 0) { + document.getElementsByClassName('Modal-backdrop')[0].onclick = function(event){ + if (event.target==this) { + let closeButton = document.getElementsByClassName('Modal-closeButton')[0] + if(closeButton) { + closeButton.click(); + } + } + } + } + } + + if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 + document.addEventListener('DOMNodeInserted', removeLoginModal); + document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录]按钮跳转至登录页面 + document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎]按钮跳转至注册页面(实际上是同一个页面) + } else if(window.location.href.indexOf("zhuanlan") > -1){ + document.addEventListener('DOMNodeInserted', removeLoginModal); + } + document.addEventListener('DOMNodeInserted', collapseNowComment); // 收起当前评论(监听点击事件,点击网页两侧空白处) +} + + +// 监听 XMLHttpRequest 事件 +function EventXMLHttpRequest() { + var _send = window.XMLHttpRequest.prototype.send + function sendReplacement(data) { + //console.log(`111111`); + addTypeTips(); + return _send.apply(this, arguments); + } + window.XMLHttpRequest.prototype.send = sendReplacement; +} + +/*(function (open) { + XMLHttpRequest.prototype.open = function () { + this.addEventListener("readystatechange", function () { + //console.log(this.responseURL); + }, false); + open.apply(this, arguments); + }; +})(XMLHttpRequest.prototype.open);*/ + + // 置顶显示时间 - 首页,来自:https://greasyfork.org/scripts/402808 function topTime_index() { @@ -339,6 +545,7 @@ function directLink () { $(".TopstoryItem--advertCard").hide(); } + // 默认高清原图,来自:https://greasyfork.org/scripts/402808 function originalPic(){ $("img").each(function(){ @@ -351,199 +558,10 @@ function originalPic(){ $(".Modal-inner").css({"overflow-y":"hidden"}) } -// 一键收起回答 -function collapsedAnswer(){ - if(menu_value('menu_collapsedAnswer')){ - let button_Add = `` - let style_Add = document.createElement('style'); - style_Add.innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; - document.head.appendChild(style_Add); - $(".CornerAnimayedFlex").prepend(button_Add); - $("#collapsed-button").on("click", function () { - document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { - if (el.hasAttribute('data-zop-retract-question')) { - el.click() - } - }); - }) - } -} - - -// 收起当前回答、评论(监听点击事件,点击网页两侧空白处) -function collapsedNowAnswer(selectors){ - backToTop(selectors) - if(menu_value('menu_collapsedNowAnswer')){ - document.querySelector(selectors).onclick = function(event){ - if (event.target==this) { - let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') - if(rightButton) { // 悬浮的 [收起回答] - // 固定的 [收起评论] - let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click(); - } - // 悬浮的 [收起回答] - rightButton = rightButton.querySelector('.ContentItem-rightButton') - if(rightButton && rightButton.hasAttribute('data-zop-retract-question')) { - rightButton.click(); - } - }else{ // 固定的 [收起回答] - document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { - if (el.hasAttribute('data-zop-retract-question')) { - if (isElementInViewport(el)) { - // 固定的 [收起评论] - let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click(); - } - el.click() - } - } - }) - } - - // 悬浮的 [收起评论] - let commentCollapseButton = document.querySelector('.CommentCollapseButton') - if(commentCollapseButton) { - commentCollapseButton.click(); - }else{ // 固定的 [收起评论](针对短篇没有收起按钮的回答) - document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel').forEach(function (el) { - if (el.innerText.indexOf("收起评论") > -1) { - if (isElementInViewport(el)) { - el.click() - } - } - }) - } - } - } - } -} - - -// 回到顶部(监听点击事件,鼠标右键点击网页两侧空白处) -function backToTop(selectors){ - if(menu_value('menu_backToTop')){ - document.querySelector(selectors).oncontextmenu = function(event){ - if (event.target==this) { - event.preventDefault(); - window.scrollTo(0,0) - } - } - } -} - - -//获取元素是否在可视区域 -function isElementInViewport(el) { - let rect = el.getBoundingClientRect(); - return ( - rect.top >= 0 && - rect.left >= 0 && - rect.bottom <= - (window.innerHeight || document.documentElement.clientHeight) && - rect.right <= - (window.innerWidth || document.documentElement.clientWidth) - ); -} - - -var postNum; -// 区分问题文章 -function addTypeTips() { - if(menu_value('menu_typeTips')){ - // URL 匹配正则表达式 - let patt_zhuanlan = /zhuanlan.zhihu.com/, - patt_question = /question\/\d+/, - patt_question_answer = /answer\/\d+/, - patt_video = /\/zvideo\//, - patt_tip = /zhihu_e_tips/ - let postList = document.querySelectorAll('h2.ContentItem-title a'); - postNum = document.querySelectorAll('small.zhihu_e_tips'); - //console.log(`${postList.length} ${postNum.length}`) - if (postList.length > postNum.length){ - for(let num = postNum.length;num文章 ` + postList[num].innerHTML - }else if (patt_question.test(postList[num].href)){ // 如果是问题 - if (patt_question_answer.test(postList[num].href)){ // 如果是指向回答的问题(而非指向纯问题的链接) - postList[num].innerHTML = `问题 ` + postList[num].innerHTML - }else{ - postList[num].innerHTML = `问题 ` + postList[num].innerHTML - } - }else if (patt_video.test(postList[num].href)){ // 如果是视频 - postList[num].innerHTML = `视频 ` + postList[num].innerHTML - } - //postNum += 1; - } - } - } - } -} - -// 监听 网页插入元素 事件 -function addEventListener_DOMNodeInserted() { - // 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126 - let removeLoginModal = e => { - if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper').length > 0) { - if (e.target.getElementsByClassName('Modal-wrapper')[0].querySelector('.signFlowModal')){ - e.target.getElementsByClassName('Modal-wrapper')[0].remove(); - } - setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); - } - } - - // 收起当前评论(监听点击事件,点击网页两侧空白处) - let collapseNowComment = e => { - if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper Modal-enter').length > 0) { - document.getElementsByClassName('Modal-backdrop')[0].onclick = function(event){ - if (event.target==this) { - let closeButton = document.getElementsByClassName('Modal-closeButton')[0] - if(closeButton) { - closeButton.click(); - } - } - } - } - } - - if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 - document.addEventListener('DOMNodeInserted', removeLoginModal); - document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录]按钮跳转至登录页面 - document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎]按钮跳转至注册页面(实际上是同一个页面) - } else if(window.location.href.indexOf("zhuanlan") > -1){ - document.addEventListener('DOMNodeInserted', removeLoginModal); - } - document.addEventListener('DOMNodeInserted', collapseNowComment); // 收起当前评论(监听点击事件,点击网页两侧空白处) -} - - -// 监听 XMLHttpRequest 事件 -function EventXMLHttpRequest() { - var _send = window.XMLHttpRequest.prototype.send - function sendReplacement(data) { - //console.log(`111111`); - addTypeTips(); - return _send.apply(this, arguments); - } - window.XMLHttpRequest.prototype.send = sendReplacement; -} - -/*(function (open) { - XMLHttpRequest.prototype.open = function () { - this.addEventListener("readystatechange", function () { - //console.log(this.responseURL); - }, false); - open.apply(this, arguments); - }; -})(XMLHttpRequest.prototype.open);*/ (function() { addEventListener_DOMNodeInserted(); // 监听 网页插入元素 事件 - // 默认折叠邀请,来自:https://greasyfork.org/scripts/402808 let timer=setInterval(function(){ if($(".QuestionInvitation-content").text().indexOf("更多推荐结果") > -1) From d56c52d2c78c39316603dd03dfe5c872d12977d8 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 30 Mar 2021 22:48:06 +0800 Subject: [PATCH 0142/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 874b60746..e15dcadd3 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.0 +// @version 1.1.1 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、浏览回答向下翻时自动隐藏标题、文章编辑页面与实际文章宽度一致、屏蔽登录提示 +// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -22,7 +22,7 @@ ['menu_widescreenDisplay', '宽屏显示', '一键收起回答', true], ['menu_picHeight', '调整图片最大高度', '调整图片最大高度', true], ['menu_postimg', '隐藏文章开头大图', '隐藏文章开头大图', true], - ['menu_hideTitle', '隐藏浏览回答标题', '隐藏浏览回答标题', true] + ['menu_hideTitle', '向下翻时自动隐藏顶栏', '向下翻时自动隐藏顶栏', true] ], menu_ID = []; for (let i=0;i Date: Wed, 31 Mar 2021 00:03:25 +0800 Subject: [PATCH 0143/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index e2e06bed5..7e4b3e2b6 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.4 +// @version 1.1.5 // @author X.I.U // @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化)、小众软件、PubMed、三国杀论坛 // @match *://www.423down.com/* @@ -28,7 +28,10 @@ // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; - // 自动翻页规则,HT_insert:1 = 插入元素前面;2 = 插入元素中的最后一个子元素后面 + // 自动翻页规则 + // type:1 = 脚本实现自动无缝翻页,2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可,这时 nextText 为按钮文本,避免一瞬间加载太多次下一页 + // HT_insert:1 = 插入元素前面;2 = 插入元素中的最后一个子元素后面 + // scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页) let DBSite = { _423down_postslist: { SiteTypeID: 1, @@ -68,6 +71,7 @@ pager: { type: 2, nextLink: 'button.load-button.next-page', + nextText: 'Show more', scrollDelta: 1500 } }, @@ -75,7 +79,8 @@ SiteTypeID: 5, pager: { type: 2, - nextLink: 'a.bm_h', + nextLink: '#autopbn', + nextText: '下一页 »', scrollDelta: 800 } }, @@ -145,7 +150,7 @@ ShowPager.loadMorePage(); }else{ let autopbn = document.querySelector(curSite.pager.nextLink); - if (autopbn){ + if (autopbn && autopbn.innerText == curSite.pager.nextText){ // 如果正在加载,就不再点击 autopbn.click(); } } From d7ccac3c83e5c75f44c681325f868659ea46b366 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 31 Mar 2021 00:54:27 +0800 Subject: [PATCH 0144/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 79 +++++++++++++++++++++++++++------------- README.md | 2 +- 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 1a7e8f846..119abfd3e 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.4 +// @version 1.2.5 // @author X.I.U -// @description 自动签到、自动无缝翻页(全站)、屏蔽导读悬赏贴(最新发表) +// @description 自动签到、自动无缝翻页、屏蔽导读悬赏贴(最新发表页) // @match *://www.52pojie.cn/* // @icon https://www.52pojie.cn/favicon.ico // @grant GM_xmlhttpRequest @@ -19,6 +19,7 @@ (function() { var menu_ALL = [ + ['menu_autoClockIn', '自动签到', '自动签到', true], ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_delateReward', '屏蔽导读悬赏贴(最新发表)', '屏蔽导读悬赏贴', true] ], menu_ID = []; @@ -67,17 +68,24 @@ // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; - // 自动翻页规则,scrollDelta 数值越大,滚动条触发点越靠上 + // 自动翻页规则 + // type:1 = 脚本实现自动无缝翻页,2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可,这时 nextText 为按钮文本,避免一瞬间加载太多次下一页 + // HT_insert:1 = 插入元素前面;2 = 插入元素中的最后一个子元素后面 + // scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页) let DBSite = { forum: { SiteTypeID: 1, pager: { + type: 2, + nextLink: '#autopbn', + nextText: '下一页 »', scrollDelta: 766 } }, thread: { SiteTypeID: 2, pager: { + type: 1, nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div#postlist > div[id^="post_"]', HT_insert: ['css;div#postlist', 2], @@ -88,6 +96,7 @@ guide: { SiteTypeID: 3, pager: { + type: 1, nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div#threadlist div.bm_c table > tbody[id^="normalthread_"]', HT_insert: ['css;div#threadlist div.bm_c table', 2], @@ -98,6 +107,7 @@ collection: { SiteTypeID: 4, pager: { + type: 1, nextLink: '//div[@class="pg"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div#ct div.bm_c table > tbody', HT_insert: ['css;div#ct div.bm_c table', 2], @@ -108,6 +118,7 @@ search: { SiteTypeID: 5, pager: { + type: 1, nextLink: '//a[@class="nxt"][@href]', pageElement: 'css;div#threadlist > ul', HT_insert: ['css;div#threadlist', 2], @@ -117,15 +128,6 @@ } }; - // 用于脚本内部判断当前 URL 类型 - let SiteType = { - FORUM: DBSite.forum.SiteTypeID, // 各板块帖子列表 - THREAD: DBSite.thread.SiteTypeID, // 帖子内 - GUIDE: DBSite.guide.SiteTypeID, // 导读帖子列表 - COLLECTION: DBSite.collection.SiteTypeID, // 淘贴列表 - SEARCH: DBSite.search.SiteTypeID // 搜索结果列表 - }; - // URL 匹配正则表达式 let patt_thread = /\/thread-\d+-\d+\-\d+.html/, patt_thread_2 = /mod\=viewthread/, @@ -150,12 +152,12 @@ curSite = DBSite.collection; // 淘贴列表 }else if(location.pathname === '/search.php'){ curSite = DBSite.search; // 搜索结果列表 - }else if(location.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){ - window.opener=null;window.open('','_self');window.close(); // 关闭当前网页标签页 + /*}else if(location.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){ + window.opener=null;window.open('','_self');window.close(); // 签到完成页面,关闭该标签页*/ } curSite.pageUrl = ""; // 下一页URL - qianDao(); // 看看有没有签到 + qianDao(); // 自动签到 pageLoading(); // 自动翻页 @@ -167,13 +169,13 @@ let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; let scrollDelta = curSite.pager.scrollDelta; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { - if (curSite.SiteTypeID === SiteType.FORUM) { // 如果是原创、精品等版块则直接点下一页就行了 - let autopbn = document.querySelector('#autopbn'); - if (autopbn && autopbn.innerText == "下一页 »"){ // 如果没有在加载时,再去点击,免得一不注意加载几十页 + if (curSite.pager.type === 1) { + ShowPager.loadMorePage(); + }else{ + let autopbn = document.querySelector(curSite.pager.nextLink); + if (autopbn && autopbn.innerText == curSite.pager.nextText){ // 如果正在加载,就不再点击 autopbn.click(); } - }else{ - ShowPager.loadMorePage(); } } } @@ -183,12 +185,39 @@ // 自动签到 + /*function qianDao() { + if (menu_value('menu_autoClockIn')){ + let qiandao = document.querySelector('#um p:last-child a:first-child'); + if (qiandao && qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"){ + window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 + qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] + qiandao.href = "#" // 修改 URL 为 # + } + } + }*/ + + + // 自动签到(后台) function qianDao() { - let qiandao = document.querySelector('#um p:last-child a:first-child'); - if (qiandao && qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"){ - window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 - qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] - qiandao.href = "#" // 修改 URL 为 # + if (menu_value('menu_autoClockIn')) { + let qiandao = document.querySelector('#um a[href="home.php?mod=task&do=apply&id=2"]'); + if (qiandao){ + GM_xmlhttpRequest({ + url: qiandao.href, + method: "GET", + timeout: 5000, + onload: function (response) { + let html = ShowPager.createDocumentByString(response.responseText); + html = html.querySelector('#messagetext p') + if (html && html.innerText.indexOf("任务已完成") > -1) { + qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] + qiandao.href = "#" // 修改 URL 为 # + }else{ + GM_notification({text: '自动签到失败!请联系作者解决!', title: '吾爱破解论坛增强', timeout: 3000}); + } + } + }); + } } } diff --git a/README.md b/README.md index 3f0e7c41c..3e714a108 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ | [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页**、屏蔽导读悬赏贴(最新发表) | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页**、屏蔽导读悬赏贴(最新发表页) | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | | [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示隐藏回复(帖子内) | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | From 01216ea580277252cfb3d0c25979cb3473bda57d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:28:25 +0800 Subject: [PATCH 0145/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=8F=9C=E5=8D=95=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 4c2ec5c3a..922d3d5cb 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 3DM论坛增强 -// @version 1.0.7 +// @version 1.0.8 // @author X.I.U -// @description 自动回复、自动无缝翻页、清理置顶帖子 +// @description 自动回复、自动无缝翻页、清理置顶帖子、自动滚动至隐藏内容 // @match *://bbs.3dmgame.com/* // @icon https://www.3dmgame.com/favicon.ico // @grant GM_xmlhttpRequest @@ -19,9 +19,9 @@ (function() { var menu_ALL = [ - ['menu_thread_pageLoading', '自动回复', '自动回复', true], - ['menu_autoReply', '清理置顶帖子', '清理置顶帖子', true], - ['menu_cleanTopPost', '帖子内自动翻页', '帖子内自动翻页', true], + ['menu_autoReply', '自动回复', '自动回复', true], + ['menu_cleanTopPost', '清理置顶帖子', '清理置顶帖子', true], + ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_scrollToShowhide', '自动滚动至隐藏内容', '自动滚动至隐藏内容', true] ], menu_ID = []; for (let i=0;i Date: Wed, 31 Mar 2021 11:38:51 +0800 Subject: [PATCH 0146/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E9=A1=B6=E9=83=A8]=EF=BC=88=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=B8=A4=E4=BE=A7=E7=A9=BA=E7=99=BD=E5=A4=84?= =?UTF-8?q?=EF=BC=89=E5=8A=9F=E8=83=BD;=20=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=9B=9E=E5=A4=8D=E3=80=81=E8=87=AA=E5=8A=A8=E6=97=A0?= =?UTF-8?q?=E7=BC=9D=E7=BF=BB=E9=A1=B5=E3=80=81=E6=B8=85=E7=90=86=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E5=B8=96=E5=AD=90]=20=E8=84=9A=E6=9C=AC=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhiyoo-Enhanced.user.js | 93 +++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index bcd957318..2b37946d7 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 智友邦论坛增强 -// @version 1.1.7 +// @version 1.1.8 // @author X.I.U -// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、简化附件兑换/下载、清理帖子标题〖XXX〗【XXX】文字 +// @description 自动签到、自动回复、自动无缝翻页、回到顶部(右键点击两侧空白处)、清理置顶帖子、简化附件兑换/下载、清理帖子标题〖XXX〗【XXX】文字 // @icon http://bbs.zhiyoo.net/favicon.ico // @match *://bbs.zhiyoo.net/* // @match *://www.zhiyoo.net/search.php* @@ -20,6 +20,10 @@ (function() { var menu_ALL = [ + ['menu_autoReply', '自动回复', '自动回复', true], + ['menu_pageLoading', '自动无缝翻页', '自动无缝翻页', true], + ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true], + ['menu_cleanTopPost', '清理置顶帖子', '清理置顶帖子', true], ['menu_cleanPostTitle', '清理帖子标题开头〖〗【】文字', '清理帖子标题开头〖〗【】文字', true], ['menu_qianDaoRedirectURL', '当前页面设为签到后重定向地址', '已设置当前页面为签到后重定向地址', 'http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline'] ], menu_ID = []; @@ -166,6 +170,7 @@ pageLoading(); // 自动无缝翻页 break; } + backToTop(); // 回到顶部(右键点击两侧空白处) }else if(location.pathname === '/search.php'){ curSite = DBSite.search; // 搜索结果列表页(自动翻页) pageLoading(); // 自动无缝翻页 @@ -184,29 +189,13 @@ } - // 自动翻页 - function pageLoading() { - if (curSite.SiteTypeID > 0){ - windowScroll(function (direction, e) { - if (direction === "down") { // 下滑才准备翻页 - let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; - let scrollDelta = 666; - if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { - ShowPager.loadMorePage(); - } - } - }); - } - } - - // 自动签到 function qiandao(){ if (loginStatus){ - if(document.getElementById("yl")) + if(document.getElementById('yl')) { - document.querySelector('#yl').click(); - document.querySelector('.tr3.tac div a').click(); + document.getElementById('yl').click(); + document.querySelector('td.tr3.tac div a').click(); } setTimeout(location.href=menu_value('menu_qianDaoRedirectURL'), 2000); // 跳转到指定URL } @@ -215,6 +204,7 @@ // 自动回复 function autoReply(){ + if (!menu_value('menu_autoReply')) return if (loginStatus){ // 存在隐藏内容,自动回复 if (document.getElementsByClassName("showhide").length == 0){ @@ -262,6 +252,45 @@ } + // 自动无缝翻页 + function pageLoading() { + if (!menu_value('menu_pageLoading')) return + if (curSite.SiteTypeID > 0){ + windowScroll(function (direction, e) { + if (direction === "down") { // 下滑才准备翻页 + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + let scrollDelta = 666; + if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { + ShowPager.loadMorePage(); + } + } + }); + } + } + + + // 回到顶部(右键点击空白处) + function backToTop() { + if (!menu_value('menu_backToTop')) return + document.getElementById("nv_forum").oncontextmenu = function(event){ + if (event.target==this) { + event.preventDefault(); + window.scrollTo(0,0) + } + } + } + + + // 清理置顶帖子 + function cleanTop(){ + if (!menu_value('menu_cleanTopPost')) return + let showhide = document.querySelectorAll("a.showhide.y"); + if (showhide.length > 0){ + showhide.forEach(el=>el.click()); + } + } + + // 兑换附件后立即返回 function attachmentBack() { let attachmentback = document.querySelector('#messagetext p.alert_btnleft a'); @@ -295,24 +324,14 @@ } - // 清理置顶帖子 - function cleanTop(){ - let showhide = document.querySelectorAll("a.showhide.y"); - if (showhide.length > 0){ - showhide.forEach(el=>el.click()); - } - } - - // 清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字 function cleanPostTitle(){ - if (menu_value('menu_cleanPostTitle')){ - let cleanposttitle = document.querySelectorAll("a.s.xst"); - if (cleanposttitle.length > 0){ - for(let num = postNum;num 0){ + for(let num = postNum;num Date: Wed, 31 Mar 2021 11:47:24 +0800 Subject: [PATCH 0147/2377] README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e714a108..56a2ebf0e 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot、小众软件、PubMed... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | -| [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子 | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | +| [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子、自动滚动至隐藏... | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、样式优化、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | -| [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 增强** | 自动签到、**自动回复**、自动无缝翻页、清理置顶帖子、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | +| [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 增强** | 自动签到、**自动回复**、自动无缝翻页、快捷回到顶部、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | | [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | From 8690d134b17aacf17bbb9754edaf7eeccd9147d4 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 31 Mar 2021 13:08:18 +0800 Subject: [PATCH 0148/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[V2ex=20?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA]=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + V2ex-Enhanced.user.js | 374 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 375 insertions(+) create mode 100644 V2ex-Enhanced.user.js diff --git a/README.md b/README.md index 56a2ebf0e..ba47eace6 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ | :----: | :---- | :---- | :----: | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、隐藏文章开头大图、调整图片最大高度、隐藏浏览... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、自动无缝翻页、回到顶部 (右键点击两侧空白处... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot、小众软件、PubMed... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js new file mode 100644 index 000000000..aeb4ec128 --- /dev/null +++ b/V2ex-Enhanced.user.js @@ -0,0 +1,374 @@ +// ==UserScript== +// @name V2ex 增强 +// @version 1.0.0 +// @author X.I.U +// @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处) +// @match *://v2ex.com/* +// @match *://*.v2ex.com/* +// @icon https://www.v2ex.com/static/favicon.ico +// @grant GM_xmlhttpRequest +// @grant GM_registerMenuCommand +// @grant GM_unregisterMenuCommand +// @grant GM_openInTab +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_notification +// @license GPL-3.0 License +// @run-at document-end +// @namespace https://github.com/XIU2/UserScript +// ==/UserScript== + +(function() { + var menu_ALL = [ + ['menu_autoClockIn', '自动签到', '自动签到', true], + ['menu_pageLoading', '自动无缝翻页', '自动无缝翻页', true], + ['menu_pageLoading_reply', '帖子内自动翻页', '帖子内自动翻页', false], + ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true] + ], menu_ID = []; + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i table', + scrollDelta: 600 + } + }, + notifications: { // 提醒消息页 + SiteTypeID: 2, + pager: { + type: 1, + nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', + pageElement: 'css;#notifications > div', + HT_insert: ['css;#notifications', 2], + replaceE: 'css;#Main .box > .cell:not(.item) > table', + scrollDelta: 600 + } + }, + replies: { // 用户回复页 + SiteTypeID: 3, + pager: { + type: 1, + nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', + pageElement: '//*[@id="Main"]//div[@class="box"]//div[@class="dock_area"] | //*[@id="Main"]//div[@class="box"]//div[@class="inner"] | //*[@id="Main"]//div[@class="box"]//div[@class="dock_area"][last()]/following-sibling::div[@class="cell"][1]', + HT_insert: ['//*[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], + replaceE: 'css;#Main .box .cell:not(.item) > table', + scrollDelta: 1000 + } + }, + go: { // 分类主题页 + SiteTypeID: 4, + pager: { + type: 1, + nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', + pageElement: 'css;#TopicsNode > div', + HT_insert: ['css;#TopicsNode', 2], + replaceE: 'css;#Main .box > .cell:not(.item) > table', + scrollDelta: 700 + } + }, + reply: { // 帖子内容页 + SiteTypeID: 5, + pager: { + type: 1, + nextLink: '//a[@class="page_current"]/preceding-sibling::a[1][@href]', + pageElement: 'css;.cell[id^="r_"]', + HT_insert: ['//div[starts-with(@id, "r_")][last()]/following-sibling::div[@class="cell"][1]', 1], + replaceE: 'css;#Main .box > .cell:not(.normalUser) > table', + scrollDelta: 700 + } + }, + reply_positive: { // 帖子内容页(正序) + SiteTypeID: 6, + pager: { + type: 1, + nextLink: '//a[@class="page_current"]/preceding-sibling::a[1][@href]', + pageElement: 'css;.cell[id^="r_"]', + HT_insert: ['//div[starts-with(@id, "r_")][position()=1]', 1], + replaceE: 'css;#Main .box > .cell:not(.normalUser) > table', + scrollDelta: 700 + } + } + }; + + + switch (location.pathname) { + case "/recent": // 最近主题页 + curSite = DBSite.recent; + break; + case "/notifications": // 提醒消息页 + curSite = DBSite.notifications; + break; + case "/member/XIU2/replies": // 用户回复页 + curSite = DBSite.replies; + break; + default: + if (location.pathname.indexOf('/go/') > -1) { // 分类主题页 + curSite = DBSite.go; + } else if (location.pathname.indexOf('/t/') > -1) { // 帖子内容页 + if(menu_value('menu_pageLoading_reply'))curSite = DBSite.reply_positive; + } + } + + curSite.pageUrl = ""; // 下一页URL + if(menu_value('menu_autoClockIn'))setTimeout(qianDao, 1000) // 自动签到(后台),延迟 1 秒执行是为了兼容 [V2ex Plus] 扩展 + if(menu_value('menu_pageLoading'))pageLoading // 自动翻页(无缝) + if(menu_value('menu_backToTop'))backToTop(); // 回到顶部(右键点击空白处) + + + // 自动签到(后台) + function qianDao() { + let qiandao = document.querySelector('.box .inner a[href="/mission/daily"]'); + if (qiandao) { + let url = (location.origin + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector('div#Top .tools').innerHTML)[0]); + GM_xmlhttpRequest({ + url: url, + method: "GET", + timeout: 5000, + onload: function (response) { + let html = ShowPager.createDocumentByString(response.responseText); + console.log(html) + if (html.querySelector('li.fa.fa-ok-sign')) { + html = html.getElementById('Main').innerText.match(/已连续登录 (\d+?) 天/)[0]; + qiandao.innerText = `自动签到成功!${html}`; + qiandao.href = '#'; + } else { + GM_notification({text: '自动签到失败!请联系作者解决!', timeout: 4000}); + } + } + }); + } else if (document.getElementById('gift_v2excellent')) { // 兼容 [V2ex Plus] 扩展 + document.getElementById('gift_v2excellent').click(); + } + } + + + // 回到顶部(右键点击空白处) + function backToTop() { + document.getElementById("Wrapper").oncontextmenu = function(event){ + if (event.target==this) { + event.preventDefault(); + window.scrollTo(0,0) + } + } + /*let backToTop = `
    ` + let backToTop_add = document.createElement('div'); + backToTop_add.innerHTML = `${backToTop}`; + document.body.appendChild(backToTop_add);*/ + } + + + // 自动无缝翻页 + function pageLoading() { + if (curSite.SiteTypeID > 0){ + windowScroll(function (direction, e) { + if (direction === "down") { // 下滑才准备翻页 + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + //console.log(document.documentElement.scrollHeight) + let scrollDelta = curSite.pager.scrollDelta; + if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { + if (curSite.pager.type === 1) { + ShowPager.loadMorePage(); + }else{ + let autopbn = document.querySelector(curSite.pager.nextLink); + if (autopbn){ + autopbn.click(); + } + } + } + } + }); + } + } + + + // 滚动条事件 + function windowScroll(fn1) { + var beforeScrollTop = document.documentElement.scrollTop, + fn = fn1 || function () {}; + setTimeout(function () { // 延时执行,避免刚载入到页面就触发翻页事件 + window.addEventListener("scroll", function (e) { + var afterScrollTop = document.documentElement.scrollTop, + delta = afterScrollTop - beforeScrollTop; + if (delta == 0) return false; + fn(delta > 0 ? "down" : "up", e); + beforeScrollTop = afterScrollTop; + }, false); + }, 1000) + } + + + var ShowPager = { // 修改自 https://greasyfork.org/scripts/14178 + getFullHref: function (e) { + if(e == null) return ''; + "string" != typeof e && (e = e.getAttribute("href")); + var t = this.getFullHref.a; + return t || (this.getFullHref.a = t = document.createElement("a")), t.href = e, t.href; + }, + createDocumentByString: function (e) { + if (e) { + if ("HTML" !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, "application/xhtml+xml"); + var t; + try { + t = (new DOMParser).parseFromString(e, "text/html"); + } catch (e) { + } + if (t) return t; + if (document.implementation.createHTMLDocument) t = document.implementation.createHTMLDocument("ADocument"); else try { + (t = document.cloneNode(!1)).appendChild(t.importNode(document.documentElement, !1)), + t.documentElement.appendChild(t.createElement("head")), t.documentElement.appendChild(t.createElement("body")); + } catch (e) { + } + if (t) { + var r = document.createRange(); + r.selectNodeContents(document.body); + var n = r.createContextualFragment(e); + t.body.appendChild(n); + for (var a, o = { + TITLE: !0, + META: !0, + LINK: !0, + STYLE: !0, + BASE: !0 + }, i = t.body, s = i.childNodes, c = s.length - 1; c >= 0; c--) o[(a = s[c]).nodeName] && i.removeChild(a); + return t; + } + } else console.error("没有找到要转成DOM的字符串"); + }, + loadMorePage: function () { + if (curSite.pager) { + let curPageEle = getElementByXpath(curSite.pager.nextLink); + var url = this.getFullHref(curPageEle); + //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + if(url === '') return; + if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 + curSite.pageUrl = url; + // 读取下一页的数据 + curSite.pager.startFilter && curSite.pager.startFilter(); + GM_xmlhttpRequest({ + url: url, + method: "GET", + timeout: 5000, + onload: function (response) { + try { + var newBody = ShowPager.createDocumentByString(response.responseText); + let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); + let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; + if (pageElems.length >= 0) { + let addTo = "beforeend"; + if (curSite.pager.HT_insert[1] == 1) addTo = "beforebegin"; + // 插入新页面元素 + pageElems.forEach(function (one) { + toElement.insertAdjacentElement(addTo, one); + }); + // 替换待替换元素 + try { + let oriE = getAllElements(curSite.pager.replaceE); + let repE = getAllElements(curSite.pager.replaceE, newBody, newBody); + if (oriE.length === repE.length) { + for (var i = 0; i < oriE.length; i++) { + oriE[i].outerHTML = repE[i].outerHTML; + } + } + } catch (e) { + console.log(e); + } + } + } catch (e) { + console.log(e); + } + } + }); + } + }, + }; + + + function getElementByXpath(e, t, r) { + r = r || document, t = t || r; + try { + return r.evaluate(e, t, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; + } catch (t) { + return void console.error("无效的xpath"); + } + } + + + function getAllElements(e, t, r, n, o) { + let getAllElementsByXpath = function(e, t, r) { + return r = r || document, t = t || r, r.evaluate(e, t, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + } + + var i, s = []; + if (!e) return s; + if (r = r || document, n = n || window, o = o || void 0, t = t || r, "string" == typeof e) i = 0 === e.search(/^css;/i) ? function getAllElementsByCSS(e, t) { + return (t || document).querySelectorAll(e); + }(e.slice(4), t) : getAllElementsByXpath(e, t, r); else { + if (!(i = e(r, n, o))) return s; + if (i.nodeType) return s[0] = i, s; + } + return function makeArray(e) { + var t, r, n, o = []; + if (e.pop) { + for (t = 0, r = e.length; t < r; t++) (n = e[t]) && (n.nodeType ? o.push(n) : o = o.concat(makeArray(n))); + return a()(o); + } + if (e.item) { + for (t = e.length; t;) o[--t] = e[t]; + return o; + } + if (e.iterateNext) { + for (t = e.snapshotLength; t;) o[--t] = e.snapshotItem(t); + return o; + } + }(i); + } +})(); \ No newline at end of file From 8a1387c03b1ea87b8abdc4ca8866ab63f90cb4fb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 31 Mar 2021 16:09:44 +0800 Subject: [PATCH 0149/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=BC=82?= =?UTF-8?q?=E6=AC=A1=E5=85=83=E8=BD=AF=E4=BB=B6=E3=80=81=E4=B8=8D=E6=AD=BB?= =?UTF-8?q?=E9=B8=9F]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 121 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 107 insertions(+), 14 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 7e4b3e2b6..466a00526 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.5 +// @version 1.1.6 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot(原烈火汉化)、小众软件、PubMed、三国杀论坛 +// @description 自动无缝翻页,目前支持:423Down、Apphot、小众软件、PubMed、异次元软件、不死鸟、三国杀论坛 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -12,6 +12,8 @@ // @match *://www.appinn.com/?s=* // @match *://pubmed.ncbi.nlm.nih.gov/?term=* // @match *://club.sanguosha.com/* +// @match *://www.iplaysoft.com/* +// @match *://iao.su/* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -30,8 +32,9 @@ // 自动翻页规则 // type:1 = 脚本实现自动无缝翻页,2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可,这时 nextText 为按钮文本,避免一瞬间加载太多次下一页 - // HT_insert:1 = 插入元素前面;2 = 插入元素中的最后一个子元素后面 + // HT_insert:1 = 插入该元素本身的前面;2 = 插入该元素当中,第一个子元素前面;3 = 插入该元素当中,最后一个子元素后面;4 = 插入该元素本身的后面; // scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页) + // beforeFunction = 插入前执行函数;afterFunction = 插入后执行函数 let DBSite = { _423down_postslist: { SiteTypeID: 1, @@ -39,7 +42,7 @@ type: 1, nextLink: '//div[@class="paging"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div.content-wrap ul.excerpt > li', - HT_insert: ['css;div.content-wrap ul.excerpt', 2], + HT_insert: ['css;div.content-wrap ul.excerpt', 3], replaceE: 'css;div.paging', scrollDelta: 1500 } @@ -90,7 +93,7 @@ type: 1, nextLink: '//a[@class="nxt"][@href]', pageElement: 'css;div#postlist > div[id^="post_"]', - HT_insert: ['css;div#postlist', 2], + HT_insert: ['css;div#postlist', 3], replaceE: 'css;div.pg', scrollDelta: 800 } @@ -101,11 +104,44 @@ type: 1, nextLink: '//a[@class="nxt"][@href]', pageElement: 'css;div#threadlist > ul', - HT_insert: ['css;div#threadlist', 2], + HT_insert: ['css;div#threadlist', 3], replaceE: 'css;div.pg', scrollDelta: 800 } - } + }, + iplaysoft_postslist: { + SiteTypeID: 8, + pager: { + type: 1, + nextLink: '//div[@class="pagenavi"]//a[@title="下一页"][@href]', + pageElement: 'css;#postlist > div.entry', + HT_insert: ['css;#postlist > .pagenavi-button', 1], + replaceE: 'css;.pagenavi-button, .pagenavi', + scrollDelta: 1200, + beforeFunction: iplaysoft_postslist_beforeFunction + } + }, + iplaysoft_postcomments: { + SiteTypeID: 9, + pager: { + type: 2, + nextLink: '#loadHistoryComments', + nextText: '展开后面', + scrollDelta: 1200 + } + }, + iao_su_postslist: { + SiteTypeID: 10, + pager: { + type: 1, + nextLink: '//li[@class="btn btn-primary next"]//a[@href]', + pageElement: 'css;#index > article, #archive > article', + HT_insert: ['css;ol.page-navigator', 1], + replaceE: 'css;ol.page-navigator', + scrollDelta: 1000, + beforeFunction: iao_su_postslist_beforeFunction + } + }, }; @@ -132,6 +168,16 @@ curSite = DBSite.sanguosha_search; } break; + case "www.iplaysoft.com": + if(location.pathname.indexOf(".html") > -1 || location.pathname.indexOf("/p/") > -1){ // 文章内 + curSite = DBSite.iplaysoft_postcomments; + }else{ // 其他页面 + curSite = DBSite.iplaysoft_postslist; + } + break; + case "iao.su": + curSite = DBSite.iao_su_postslist; + break; } curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动无缝翻页 @@ -143,15 +189,18 @@ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; - //console.log(document.documentElement.scrollHeight) let scrollDelta = curSite.pager.scrollDelta; if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { if (curSite.pager.type === 1) { ShowPager.loadMorePage(); }else{ let autopbn = document.querySelector(curSite.pager.nextLink); - if (autopbn && autopbn.innerText == curSite.pager.nextText){ // 如果正在加载,就不再点击 - autopbn.click(); + if (autopbn){ // 如果正在加载,就不再点击 + if (!curSite.pager.nextText){ // 如果没有指定 nextText 就直接点击 + autopbn.click(); + }else if (autopbn.innerText.indexOf(curSite.pager.nextText) > -1){ // 如果指定了 nextText 就需要判断后再点击(避免已经在加载了,还重复点击) + autopbn.click(); + } } } } @@ -169,6 +218,32 @@ } + // iplaysoft 的插入前函数 + function iplaysoft_postslist_beforeFunction(pageElems) { + pageElems.forEach(function (one) { + let now = one.querySelector("img.lazyload") + if (now && !now.getAttribute('src')) { + now.setAttribute("src",now.getAttribute('data-src')) + now.setAttribute("srcset",now.getAttribute('data-src')) + now.setAttribute("class","lazyloaded") + } + }); + return pageElems + } + + + // iao.su 的插入前函数 + function iao_su_postslist_beforeFunction(pageElems) { + pageElems.forEach(function (one) { + let now = one.getElementsByClassName("post-card")[0] + if (now) { + now.getElementsByClassName("blog-background")[0].style.backgroundImage = 'url("' + RegExp("(?<=loadBannerDirect\\(').*(?=', '',)").exec(now.getElementsByTagName("script")[0].innerText)[0]; + '")'; + } + }); + return pageElems + } + + // 滚动条事件 function windowScroll(fn1) { var beforeScrollTop = document.documentElement.scrollTop, @@ -226,9 +301,9 @@ if (curSite.pager) { let curPageEle = getElementByXpath(curSite.pager.nextLink); var url = this.getFullHref(curPageEle); - //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); if(url === '') return; - if(curSite.pageUrl === url) return;// 不会重复加载相同的页面 + if(curSite.pageUrl === url) return;// 避免重复加载相同的页面 curSite.pageUrl = url; // 读取下一页的数据 curSite.pager.startFilter && curSite.pager.startFilter(); @@ -243,8 +318,24 @@ let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; if (pageElems.length >= 0) { - let addTo = "beforeend"; - if (curSite.pager.HT_insert[1] == 1) addTo = "beforebegin"; + // 如果有插入前函数就执行函数 + if (curSite.pager.beforeFunction)pageElems = curSite.pager.beforeFunction(pageElems); + // 插入位置 + let addTo; + switch (curSite.pager.HT_insert[1]) { + case 1: + addTo = "beforebegin" + break; + case 2: + addTo = "afterbegin" + break; + case 3: + addTo = "beforeend" + break; + case 4: + addTo = "afterend" + break; + } // 插入新页面元素 pageElems.forEach(function (one) { toElement.insertAdjacentElement(addTo, one); @@ -261,6 +352,8 @@ } catch (e) { console.log(e); } + // 如果有插入后函数就执行函数 + if (curSite.pager.afterFunction)curSite.pager.afterFunction(); } } catch (e) { console.log(e); From 4d55f2e41ddf643c272c909502a5b935afab2c54 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 31 Mar 2021 16:28:24 +0800 Subject: [PATCH 0150/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=BC=82?= =?UTF-8?q?=E6=AC=A1=E5=85=83=E8=BD=AF=E4=BB=B6=E3=80=81=E4=B8=8D=E6=AD=BB?= =?UTF-8?q?=E9=B8=9F]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 82 ++++++++++++++++++++++++------------------------ README.md | 2 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 466a00526..afe7824e5 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -2,7 +2,7 @@ // @name 自动无缝翻页 // @version 1.1.6 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、小众软件、PubMed、异次元软件、不死鸟、三国杀论坛 +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、三国杀论坛、PubMed // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -25,7 +25,7 @@ (function() { // 注册脚本菜单 - GM_registerMenuCommand('反馈 & 申请添加支持', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + GM_registerMenuCommand('反馈 & 欢迎申请支持', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});}); // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; @@ -58,8 +58,20 @@ scrollDelta: 1500 } }, - appinn_postslist: { + iao_su_postslist: { SiteTypeID: 3, + pager: { + type: 1, + nextLink: '//li[@class="btn btn-primary next"]//a[@href]', + pageElement: 'css;#index > article, #archive > article', + HT_insert: ['css;ol.page-navigator', 1], + replaceE: 'css;ol.page-navigator', + scrollDelta: 800, + beforeFunction: iao_su_postslist_beforeFunction + } + }, + appinn_postslist: { + SiteTypeID: 4, pager: { type: 1, nextLink: '//a[@class="next page-numbers"][@href]', @@ -69,17 +81,29 @@ scrollDelta: 1500 } }, - pubmed_postslist: { - SiteTypeID: 4, + iplaysoft_postslist: { + SiteTypeID: 5, + pager: { + type: 1, + nextLink: '//div[@class="pagenavi"]//a[@title="下一页"][@href]', + pageElement: 'css;#postlist > div.entry', + HT_insert: ['css;#postlist > .pagenavi-button', 1], + replaceE: 'css;.pagenavi-button, .pagenavi', + scrollDelta: 1200, + beforeFunction: iplaysoft_postslist_beforeFunction + } + }, + iplaysoft_postcomments: { + SiteTypeID: 6, pager: { type: 2, - nextLink: 'button.load-button.next-page', - nextText: 'Show more', - scrollDelta: 1500 + nextLink: '#loadHistoryComments', + nextText: '展开后面', + scrollDelta: 1200 } }, sanguosha_forum: { - SiteTypeID: 5, + SiteTypeID: 7, pager: { type: 2, nextLink: '#autopbn', @@ -88,7 +112,7 @@ } }, sanguosha_thread: { - SiteTypeID: 6, + SiteTypeID: 8, pager: { type: 1, nextLink: '//a[@class="nxt"][@href]', @@ -99,7 +123,7 @@ } }, sanguosha_search: { - SiteTypeID: 7, + SiteTypeID: 9, pager: { type: 1, nextLink: '//a[@class="nxt"][@href]', @@ -109,39 +133,15 @@ scrollDelta: 800 } }, - iplaysoft_postslist: { - SiteTypeID: 8, - pager: { - type: 1, - nextLink: '//div[@class="pagenavi"]//a[@title="下一页"][@href]', - pageElement: 'css;#postlist > div.entry', - HT_insert: ['css;#postlist > .pagenavi-button', 1], - replaceE: 'css;.pagenavi-button, .pagenavi', - scrollDelta: 1200, - beforeFunction: iplaysoft_postslist_beforeFunction - } - }, - iplaysoft_postcomments: { - SiteTypeID: 9, - pager: { - type: 2, - nextLink: '#loadHistoryComments', - nextText: '展开后面', - scrollDelta: 1200 - } - }, - iao_su_postslist: { + pubmed_postslist: { SiteTypeID: 10, pager: { - type: 1, - nextLink: '//li[@class="btn btn-primary next"]//a[@href]', - pageElement: 'css;#index > article, #archive > article', - HT_insert: ['css;ol.page-navigator', 1], - replaceE: 'css;ol.page-navigator', - scrollDelta: 1000, - beforeFunction: iao_su_postslist_beforeFunction + type: 2, + nextLink: 'button.load-button.next-page', + nextText: 'Show more', + scrollDelta: 1500 } - }, + } }; diff --git a/README.md b/README.md index ba47eace6..834da5477 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、自动无缝翻页、回到顶部 (右键点击两侧空白处... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 目前支持:423Down、Apphot、小众软件、PubMed... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 423Down、Apphot、不死鸟、小众软件、异次元软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子、自动滚动至隐藏... | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、样式优化、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | From ffba3b7adafb444fc573bacecd1877a685c053b9 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 31 Mar 2021 19:41:03 +0800 Subject: [PATCH 0151/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[AlphaCoders]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=EF=BC=88=E4=B8=80=E4=B8=AA=E5=A3=81=E7=BA=B8?= =?UTF-8?q?=E7=BD=91=E7=AB=99=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 49 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index afe7824e5..7434f7cef 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,19 +1,20 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.6 +// @version 1.1.7 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、三国杀论坛、PubMed +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、AlphaCoders、三国杀论坛、PubMed // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* // @exclude *://apphot.cc/*.html +// @match *://iao.su/* // @match *://www.appinn.com/ // @match *://www.appinn.com/*/*/ // @match *://www.appinn.com/?s=* -// @match *://pubmed.ncbi.nlm.nih.gov/?term=* -// @match *://club.sanguosha.com/* // @match *://www.iplaysoft.com/* -// @match *://iao.su/* +// @match *://*.alphacoders.com/* +// @match *://club.sanguosha.com/* +// @match *://pubmed.ncbi.nlm.nih.gov/?term=* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -141,6 +142,17 @@ nextText: 'Show more', scrollDelta: 1500 } + }, + wall_alphacoders: { + SiteTypeID: 11, + pager: { + type: 1, + nextLink: '//a[@id="next_page"][@href]', + pageElement: 'css;.thumb-container-big, .avatar-thumb, .thumb-element', + HT_insert: ['css;.thumb-container-big:nth-last-child(1), .avatar-thumb:nth-last-child(1), .thumb-element:nth-last-child(1)', 4], + replaceE: '//div[@class="hidden-xs hidden-sm"]/..', + scrollDelta: 1000 + } } }; @@ -152,11 +164,23 @@ case "apphot.cc": curSite = DBSite.apphot_postslist; break; + case "iao.su": + curSite = DBSite.iao_su_postslist; + break; case "www.appinn.com": curSite = DBSite.appinn_postslist; break; - case "pubmed.ncbi.nlm.nih.gov": - curSite = DBSite.pubmed_postslist; + case "www.iplaysoft.com": + if(location.pathname.indexOf(".html") > -1 || location.pathname.indexOf("/p/") > -1){ // 文章内 + curSite = DBSite.iplaysoft_postcomments; + }else{ // 其他页面 + curSite = DBSite.iplaysoft_postslist; + } + break; + case "wall.alphacoders.com": + case "avatars.alphacoders.com": + case "mobile.alphacoders.com": + curSite = DBSite.wall_alphacoders; break; case "club.sanguosha.com": if(location.pathname.indexOf("forum") > -1){ // 各版块帖子列表 @@ -168,15 +192,8 @@ curSite = DBSite.sanguosha_search; } break; - case "www.iplaysoft.com": - if(location.pathname.indexOf(".html") > -1 || location.pathname.indexOf("/p/") > -1){ // 文章内 - curSite = DBSite.iplaysoft_postcomments; - }else{ // 其他页面 - curSite = DBSite.iplaysoft_postslist; - } - break; - case "iao.su": - curSite = DBSite.iao_su_postslist; + case "pubmed.ncbi.nlm.nih.gov": + curSite = DBSite.pubmed_postslist; break; } curSite.pageUrl = ""; // 下一页URL From 74fc73c54a21db8d86c84e291375928cabd7e04b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 08:43:51 +0800 Subject: [PATCH 0152/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index aeb4ec128..d4193d1ee 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name V2ex 增强 -// @version 1.0.0 +// @version 1.0.1 // @author X.I.U // @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处) // @match *://v2ex.com/* @@ -41,7 +41,7 @@ menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/424246/feedback', {active: true,insert: true,setParent: true});}); } // 菜单开关 @@ -69,7 +69,9 @@ // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; - // 自动翻页规则,HT_insert:1 = 插入该元素的前面;2 = 插入该元素内的最后面 + // 自动翻页规则 + // HT_insert:1 = 插入该元素的前面;2 = 插入该元素内的最后面 + // scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页),一般是访问网页速度越慢,该值就需要越大 let DBSite = { recent: { // 最近主题页 SiteTypeID: 1, @@ -147,20 +149,19 @@ case "/notifications": // 提醒消息页 curSite = DBSite.notifications; break; - case "/member/XIU2/replies": // 用户回复页 - curSite = DBSite.replies; - break; default: if (location.pathname.indexOf('/go/') > -1) { // 分类主题页 curSite = DBSite.go; } else if (location.pathname.indexOf('/t/') > -1) { // 帖子内容页 - if(menu_value('menu_pageLoading_reply'))curSite = DBSite.reply_positive; + if(menu_value('menu_pageLoading_reply'))curSite = DBSite.reply_positive; // 帖子内自动无缝翻页 + } else if (location.pathname.indexOf('/replies') > -1) { // 用户回复页 + curSite = DBSite.replies; } } curSite.pageUrl = ""; // 下一页URL if(menu_value('menu_autoClockIn'))setTimeout(qianDao, 1000) // 自动签到(后台),延迟 1 秒执行是为了兼容 [V2ex Plus] 扩展 - if(menu_value('menu_pageLoading'))pageLoading // 自动翻页(无缝) + if(menu_value('menu_pageLoading'))pageLoading(); // 自动翻页(无缝) if(menu_value('menu_backToTop'))backToTop(); // 回到顶部(右键点击空白处) @@ -181,7 +182,8 @@ qiandao.innerText = `自动签到成功!${html}`; qiandao.href = '#'; } else { - GM_notification({text: '自动签到失败!请联系作者解决!', timeout: 4000}); + GM_notification({text: '自动签到失败!请联系作者解决!', timeout: 4000, onclick() {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/424246/feedback', {active: true,insert: true,setParent: true});}}); + qiandao.innerText = '自动签到失败!请尝试手动签到!'; } } }); @@ -199,10 +201,6 @@ window.scrollTo(0,0) } } - /*let backToTop = `
    ` - let backToTop_add = document.createElement('div'); - backToTop_add.innerHTML = `${backToTop}`; - document.body.appendChild(backToTop_add);*/ } From 9bd6a902c2310dd6d190c806c907f64537024341 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 09:21:22 +0800 Subject: [PATCH 0153/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index d4193d1ee..265a596ef 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,5 +1,5 @@ // ==UserScript== -// @name V2ex 增强 +// @name V2EX 增强 // @version 1.0.1 // @author X.I.U // @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处) From d094142b15a6c0a9f43a12adaf79da16b89a205d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 10:01:51 +0800 Subject: [PATCH 0154/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=8F=9C=E5=8D=95=E5=BC=80=E5=85=B3=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 265a596ef..9221f9bd0 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name V2EX 增强 -// @version 1.0.1 +// @version 1.0.2 // @author X.I.U // @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处) // @match *://v2ex.com/* @@ -48,10 +48,10 @@ function menu_switch(menu_status, Name, Tips) { if (menu_status == 'true'){ GM_setValue(`${Name}`, false); - GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3000}); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3000}); }else{ GM_setValue(`${Name}`, true); - GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, title: '吾爱破解论坛增强', timeout: 3000}); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3000}); } registerMenuCommand(); // 重新注册脚本菜单 }; From 5deddb7c06e8f7605b044f36e4ac2047b41bb75b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 10:20:24 +0800 Subject: [PATCH 0155/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E9=A1=B6=E9=83=A8]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 9221f9bd0..f1c5ead43 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name V2EX 增强 -// @version 1.0.2 +// @version 1.0.3 // @author X.I.U // @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处) // @match *://v2ex.com/* @@ -195,7 +195,7 @@ // 回到顶部(右键点击空白处) function backToTop() { - document.getElementById("Wrapper").oncontextmenu = function(event){ + document.getElementById("Wrapper").oncontextmenu = document.querySelector("#Wrapper > .content").oncontextmenu = function(event){ if (event.target==this) { event.preventDefault(); window.scrollTo(0,0) From 642976262030671babecf2556e227035825b443b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 12:09:51 +0800 Subject: [PATCH 0156/2377] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20JQuery=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 140 ++++++++++----------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 0ee7c9fec..8fb0fc186 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,13 +1,11 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.1 +// @version 1.4.2 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @match *://hub.fastgit.org/* // @icon https://i.loli.net/2021/03/30/ULV9XunaHesqGIR.png -// @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js -/* globals $ */ // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab @@ -22,8 +20,8 @@ (function() { var backColor = '#ffffff'; var fontColor = '#888888'; - if($('html').attr('data-color-mode') == 'dark'){ // 黑暗模式判断 - if($('html').attr('data-dark-theme') == 'dark_dimmed'){ + if(document.getElementsByTagName('html')[0].getAttribute('data-color-mode') == 'dark'){ // 黑暗模式判断 + if(document.getElementsByTagName('html')[0].getAttribute('data-dark-theme') == 'dark_dimmed'){ backColor = '#272e37'; fontColor = '#768390'; }else{ @@ -31,6 +29,7 @@ fontColor = '#b2b8bf'; } } + var download_url = [ ['https://gh.con.sh','美国'], ['https://gh.api.99988866.xyz','美国'], @@ -59,7 +58,7 @@ style = ['padding:0 6px;margin-right: -1px;border-radius: 2px;background-color: '+backColor+';border-color: rgba(27, 31, 35, 0.1);font-size: 11px;color: '+fontColor+';'], menu_raw_fast = GM_getValue('xiu2_menu_raw_fast'), menu_menu_raw_fast_ID, menu_feedBack_ID; - if (menu_raw_fast == null || menu_raw_fast == '中国国内'){menu_raw_fast = 1; GM_setValue('xiu2_menu_raw_fast', 1)}; // 调整上个版本的设置存储变量内容 + if (menu_raw_fast == null){menu_raw_fast = 1; GM_setValue('xiu2_menu_raw_fast', 1)}; registerMenuCommand(); // 注册脚本菜单 @@ -107,9 +106,11 @@ // Release function addRelease(){ - $(".Box.Box--condensed").each(function () { - $(this).find(".d-flex.Box-body>a").each(function () { - let href = $(this).attr("href"), + let original = document.getElementsByClassName('Box Box--condensed') + if (!original) return + Array.from(original).forEach(function (current) { + current.querySelectorAll('.d-flex.Box-body > a').forEach(function (current2) { + let href = current2.href, url = [ download_url[0][0] + '/https://github.com' + href, download_url[1][0] + '/https://github.com' + href, @@ -124,15 +125,15 @@ html += `${download_url[i][1]}` } html += `` - $(this).next().after(html); + current2.nextElementSibling.insertAdjacentHTML('afterend', html); }); // 修改[文件大小]元素样式 document.querySelectorAll('small.pl-2.color-text-secondary.flex-shrink-0').forEach(el=>{el.style.cssText='display: flex; justify-content: flex-end; flex-grow: 1; margin-right: 8px;'}); // Source Code - $(this).find(".d-block.Box-body>a").each(function () { - let href = $(this).attr("href"), + current.querySelectorAll('.d-block.Box-body > a').forEach(function (current2) { + let href = current2.href, url = [ download_url[0][0] + '/https://github.com' + href, download_url[1][0] + '/https://github.com' + href, @@ -147,7 +148,7 @@ html += `${download_url[i][1]}` } html += `` - $(this).after(html); + current2.insertAdjacentHTML('afterend', html); }); }); // 修改 Source code 样式,使其和加速按钮并列一排 @@ -157,72 +158,72 @@ // Download ZIP function addDownloadZIP(){ - $(".dropdown-menu.dropdown-menu-sw.p-0 ul li:last-child").each(function () { - let href = $(this).children("a").attr("href"), - url = [ - download_url[0][0] + "/https://github.com" + href, - download_url[1][0] + "/https://github.com" + href, - download_url[2][0] + href, - download_url[3][0] + "/https://github.com" + href, - download_url[4][0] + "/https://github.com" + href, - download_url[5][0] + '/https://github.com' + href - ], - html = ``; - for (let i=0;i${svg[0]}Download ZIP ${download_url[i][1]}` - } - $(this).after(html); - }); + let original = document.querySelector('.dropdown-menu.dropdown-menu-sw.p-0 ul li:last-child'); + if (!original) return + let href = original.getElementsByTagName('a')[0].href, + url = [ + download_url[0][0] + "/https://github.com" + href, + download_url[1][0] + "/https://github.com" + href, + download_url[2][0] + href, + download_url[3][0] + "/https://github.com" + href, + download_url[4][0] + "/https://github.com" + href, + download_url[5][0] + '/https://github.com' + href + ], + html = ``; + for (let i=0;i${svg[0]}Download ZIP ${download_url[i][1]}` + } + original.insertAdjacentHTML('afterend', html); } // Git Clone function addGitClone(){ - $("[role='tabpanel'] div.input-group").first().each(function () { - let href_split = location.href.split("/"), - url = [ - clone_url[0][0] + "/" + href_split[3] + "/" + href_split[4] + ".git", - clone_url[1][0] + "/github.com/" + href_split[3] + "/" + href_split[4] + ".git", - clone_url[2][0] + "/" + href_split[3] + "/" + href_split[4] + ".git" - ], - html = ``; - for (let i=0;i
    ${svg[1]}
    ` - } - $(this).after(html); - }); + let original = document.querySelector('[role="tabpanel"] div.input-group'); + if (!original) return + let href_split = location.href.split("/"), + url = [ + clone_url[0][0] + "/" + href_split[3] + "/" + href_split[4] + ".git", + clone_url[1][0] + "/github.com/" + href_split[3] + "/" + href_split[4] + ".git", + clone_url[2][0] + "/" + href_split[3] + "/" + href_split[4] + ".git" + ], + html = ``; + for (let i=0;i
    ${svg[1]}
    ` + } + original.insertAdjacentHTML('afterend', html); } // Raw function addRawFile(){ - $("#raw-url").each(function () { - let href = location.href.replace('https://github.com',''), - href2 = href.replace('/blob/','/'), - url = [ - raw_url[1][0] + href2, - raw_url[2][0] + "/gh" + href.replace('/blob/','@'), - raw_url[3][0] + href2, - raw_url[4][0] + "/" + raw_url[0][0] + href2 - ], - html = ``; - for (let i=0;i${raw_url[i+1][1]}` - } - $(this).after(html); - }); + let original = document.getElementById('raw-url') + if (!original) return + let href = location.href.replace('https://github.com',''), + href2 = href.replace('/blob/','/'), + url = [ + raw_url[1][0] + href2, + raw_url[2][0] + "/gh" + href.replace('/blob/','@'), + raw_url[3][0] + href2, + raw_url[4][0] + "/" + raw_url[0][0] + href2 + ], + html = ``; + for (let i=0;i${raw_url[i+1][1]}` + } + original.insertAdjacentHTML('afterend', html); } // 添加 Raw 下载链接(☁) function addRawDownLink(){ // 如果不是项目文件页面,就返回 - let files = $('div.Box-row svg.octicon.octicon-file'); + let files = document.querySelectorAll('div.Box-row svg.octicon.octicon-file'); if(files.length === 0) return; - let files1 = $('a.fileDownLink'); + let files1 = document.querySelectorAll('a.fileDownLink'); if(files1.length > 0) return; // 鼠标指向则显示 @@ -244,14 +245,13 @@ }; // 循环添加 - files.each(function(i,fileElm){ + files.forEach(function(fileElm, i){ let trElm = fileElm.parentNode.parentNode, cntElm_a = trElm.querySelector('.css-truncate.css-truncate-target.d-block.width-fit a'), cntElm_svg = trElm.querySelector('.mr-3.flex-shrink-0 svg.octicon.octicon-file.color-icon-tertiary'), Name = cntElm_a.innerText, href = cntElm_a.attributes.href.nodeValue.replace('https://github.com',''); let href2 = href.replace('/blob/','/'), url, url_name, url_tip = ''; - console.log(cntElm_a, cntElm_svg, Name, href) switch(menu_raw_fast) { case 2: @@ -271,10 +271,10 @@ break; } let html = ` `; - $(cntElm_svg).after(html); + cntElm_svg.insertAdjacentHTML('afterend', html); // 绑定鼠标事件 - trElm.onmouseover=mouseOverHandler; - trElm.onmouseout=mouseOutHandler; + trElm.onmouseover = mouseOverHandler; + trElm.onmouseout = mouseOutHandler; }); } @@ -283,8 +283,8 @@ function delRawDownLink(){ let aElm = document.querySelectorAll('.fileDownLink'); if(aElm.length === 0) return; - for(let num = 0;num Date: Thu, 1 Apr 2021 13:56:25 +0800 Subject: [PATCH 0157/2377] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20JQuery=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 71 ++++++++++------------ Zhihu-Enhanced.user.js | 1 - 2 files changed, 32 insertions(+), 40 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 8fb0fc186..36f82726a 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -106,11 +106,10 @@ // Release function addRelease(){ - let original = document.getElementsByClassName('Box Box--condensed') - if (!original) return - Array.from(original).forEach(function (current) { - current.querySelectorAll('.d-flex.Box-body > a').forEach(function (current2) { - let href = current2.href, + let html = document.getElementsByClassName('Box Box--condensed');if (!html) return + Array.from(html).forEach(function (current) { + current.querySelectorAll('.d-flex.Box-body > a').forEach(function (_this) { + let href = _this.href, url = [ download_url[0][0] + '/https://github.com' + href, download_url[1][0] + '/https://github.com' + href, @@ -119,21 +118,21 @@ download_url[4][0] + '/https://github.com' + href, download_url[5][0] + '/https://github.com' + href ], - html = `
    `; + _html = `
    `; for (let i=0;i${download_url[i][1]}` + _html += `${download_url[i][1]}` } - html += `
    ` - current2.nextElementSibling.insertAdjacentHTML('afterend', html); + _html += `
    ` + _this.nextElementSibling.insertAdjacentHTML('afterend', _html); }); // 修改[文件大小]元素样式 document.querySelectorAll('small.pl-2.color-text-secondary.flex-shrink-0').forEach(el=>{el.style.cssText='display: flex; justify-content: flex-end; flex-grow: 1; margin-right: 8px;'}); // Source Code - current.querySelectorAll('.d-block.Box-body > a').forEach(function (current2) { - let href = current2.href, + current.querySelectorAll('.d-block.Box-body > a').forEach(function (_this) { + let href = _this.href, url = [ download_url[0][0] + '/https://github.com' + href, download_url[1][0] + '/https://github.com' + href, @@ -142,13 +141,13 @@ download_url[4][0] + '/https://github.com' + href, download_url[5][0] + '/https://github.com' + href ], - html = `
    `; + _html = `
    `; for (let i=0;i${download_url[i][1]}` + _html += `${download_url[i][1]}` } - html += `
    ` - current2.insertAdjacentHTML('afterend', html); + _html += `
    ` + _this.insertAdjacentHTML('afterend', _html); }); }); // 修改 Source code 样式,使其和加速按钮并列一排 @@ -158,9 +157,8 @@ // Download ZIP function addDownloadZIP(){ - let original = document.querySelector('.dropdown-menu.dropdown-menu-sw.p-0 ul li:last-child'); - if (!original) return - let href = original.getElementsByTagName('a')[0].href, + let html = document.querySelector('.dropdown-menu.dropdown-menu-sw.p-0 ul li:last-child');if (!html) return + let href = html.getElementsByTagName('a')[0].href, url = [ download_url[0][0] + "/https://github.com" + href, download_url[1][0] + "/https://github.com" + href, @@ -169,38 +167,36 @@ download_url[4][0] + "/https://github.com" + href, download_url[5][0] + '/https://github.com' + href ], - html = ``; + _html = ``; for (let i=0;i${svg[0]}Download ZIP ${download_url[i][1]}` + _html += `
  • ${svg[0]}Download ZIP ${download_url[i][1]}
  • ` } - original.insertAdjacentHTML('afterend', html); + html.insertAdjacentHTML('afterend', _html); } // Git Clone function addGitClone(){ - let original = document.querySelector('[role="tabpanel"] div.input-group'); - if (!original) return + let html = document.querySelector('[role="tabpanel"] div.input-group');if (!html) return let href_split = location.href.split("/"), url = [ clone_url[0][0] + "/" + href_split[3] + "/" + href_split[4] + ".git", clone_url[1][0] + "/github.com/" + href_split[3] + "/" + href_split[4] + ".git", clone_url[2][0] + "/" + href_split[3] + "/" + href_split[4] + ".git" ], - html = ``; + _html = ``; for (let i=0;i
    ${svg[1]}
    ` + _html += `
    ${svg[1]}
    ` } - original.insertAdjacentHTML('afterend', html); + html.insertAdjacentHTML('afterend', _html); } // Raw function addRawFile(){ - let original = document.getElementById('raw-url') - if (!original) return + let html = document.getElementById('raw-url');if (!html) return let href = location.href.replace('https://github.com',''), href2 = href.replace('/blob/','/'), url = [ @@ -209,22 +205,20 @@ raw_url[3][0] + href2, raw_url[4][0] + "/" + raw_url[0][0] + href2 ], - html = ``; + _html = ``; for (let i=0;i${raw_url[i+1][1]}` + _html += `${raw_url[i+1][1]}` } - original.insertAdjacentHTML('afterend', html); + html.insertAdjacentHTML('afterend', _html); } // 添加 Raw 下载链接(☁) function addRawDownLink(){ // 如果不是项目文件页面,就返回 - let files = document.querySelectorAll('div.Box-row svg.octicon.octicon-file'); - if(files.length === 0) return; - let files1 = document.querySelectorAll('a.fileDownLink'); - if(files1.length > 0) return; + let files = document.querySelectorAll('div.Box-row svg.octicon.octicon-file');if(files.length === 0) return; + let files1 = document.querySelectorAll('a.fileDownLink');if(files1.length > 0) return; // 鼠标指向则显示 var mouseOverHandler = function(evt){ @@ -270,8 +264,8 @@ url_tip = raw_url[menu_raw_fast][2]; break; } - let html = ` `; - cntElm_svg.insertAdjacentHTML('afterend', html); + let _html = ` `; + cntElm_svg.insertAdjacentHTML('afterend', _html); // 绑定鼠标事件 trElm.onmouseover = mouseOverHandler; trElm.onmouseout = mouseOutHandler; @@ -281,8 +275,7 @@ // 删除 Raw 快捷下载(☁) function delRawDownLink(){ - let aElm = document.querySelectorAll('.fileDownLink'); - if(aElm.length === 0) return; + let aElm = document.querySelectorAll('.fileDownLink');if(aElm.length === 0) return; aElm.forEach(function(fileElm){ fileElm.remove() }) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 2a9e43193..25c68e0ca 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -7,7 +7,6 @@ // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js -/* globals $ */ // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab From abcf984e9d2ef086e6ccb6eb0ef6d951b7a94531 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 16:16:58 +0800 Subject: [PATCH 0158/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E9=83=A8=E5=88=86=E5=B9=BF=E5=91=8A=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index e15dcadd3..93cd9c94b 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.1 +// @version 1.1.2 // @author X.I.U // @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -69,7 +69,13 @@ // 添加样式 function addStyle() { let style = `/* 屏蔽登录提示 */ -.Question-mainColumnLogin {display: none;} +.Question-mainColumnLogin {display: none !important;} +/* 屏蔽首页广告 */ +.TopstoryItem--advertCard {display: none !important;} +/* 屏蔽回答页广告 */ +.Pc-card.Card {display: none !important;} +/* 屏蔽文章页推荐文章 */ +.Recommendations-Main {display: none !important;} `, style_1 = `/* 宽屏显示 */ .GlobalSideBar,.Question-sideColumn,.ContentLayout-sideColumn,.SearchSideBar,.Card.QuestionHeaderTopicMeta { From 29d164f7fdfce8d53ae97b462575956bd18f74b6 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 17:06:23 +0800 Subject: [PATCH 0159/2377] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20jQuery=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 515 ++++++++++++++++++----------------------- 1 file changed, 221 insertions(+), 294 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 25c68e0ca..aedb52c88 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.3 +// @version 1.3.4 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -46,6 +46,7 @@ function registerMenuCommand() { menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); } + // 菜单开关 function menu_switch(menu_status, Name, Tips) { if (menu_status == 'true'){ @@ -58,6 +59,7 @@ function menu_switch(menu_status, Name, Tips) { registerMenuCommand(); // 重新注册脚本菜单 }; + // 返回菜单值 function menu_value(menuName) { for (let menu of menu_ALL) { @@ -75,14 +77,14 @@ function collapsedAnswer(){ let style_Add = document.createElement('style'); style_Add.innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; document.head.appendChild(style_Add); - $(".CornerAnimayedFlex").prepend(button_Add); - $("#collapsed-button").on("click", function () { + document.querySelector('.CornerAnimayedFlex').insertAdjacentHTML('afterBegin', button_Add); + document.getElementById('collapsed-button').onclick = function () { document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { if (el.hasAttribute('data-zop-retract-question')) { el.click() } }); - }) + } } } @@ -90,28 +92,28 @@ function collapsedAnswer(){ // 收起当前回答、评论(监听点击事件,点击网页两侧空白处) function collapsedNowAnswer(selectors){ backToTop(selectors) - if(menu_value('menu_collapsedNowAnswer')){ + if (menu_value('menu_collapsedNowAnswer')) { document.querySelector(selectors).onclick = function(event){ if (event.target==this) { let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') - if(rightButton) { // 悬浮的 [收起回答](此时正在浏览回答内容 [头部区域 + 中间区域]) + if (rightButton) { // 悬浮的 [收起回答](此时正在浏览回答内容 [头部区域 + 中间区域]) // 固定的 [收起评论](先看看是否展开评论) let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + if (commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { commentCollapseButton.click(); } // 再去收起回答 rightButton = rightButton.querySelector('.ContentItem-rightButton') - if(rightButton && rightButton.hasAttribute('data-zop-retract-question')) { + if (rightButton && rightButton.hasAttribute('data-zop-retract-question')) { rightButton.click(); } - }else{ // 固定的 [收起回答](此时正在浏览回答内容 [尾部区域]) + } else { // 固定的 [收起回答](此时正在浏览回答内容 [尾部区域]) for (let el of document.querySelectorAll('.ContentItem-rightButton')) { if (el.hasAttribute('data-zop-retract-question')) { if (isElementInViewport(el)) { // 固定的 [收起评论](先看看是否展开评论) let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if(commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + if (commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { commentCollapseButton.click(); } el.click() // 再去收起回答 @@ -124,25 +126,31 @@ function collapsedNowAnswer(selectors){ var commentCollapseButton_ = false; // 悬浮的 [收起评论](此时正在浏览评论内容 [中间区域]) let commentCollapseButton = document.querySelector('.CommentCollapseButton') - if(commentCollapseButton) { + if (commentCollapseButton) { commentCollapseButton.click(); - }else{ // 固定的 [收起评论](此时正在浏览评论内容 [头部区域]) - for (let el of document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel')) { - if (el.innerText.indexOf("收起评论") > -1) { - if (isElementInViewport(el)) { - el.click() - commentCollapseButton_ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 [收起评论] 时) - break + } else { // 固定的 [收起评论](此时正在浏览评论内容 [头部区域]) + let commentCollapseButton_1 = document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if (commentCollapseButton_1.length > 0) { + for (let el of commentCollapseButton_1) { + if (el.innerText.indexOf("收起评论") > -1) { + if (isElementInViewport(el)) { + el.click() + commentCollapseButton_ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 [收起评论] 时) + break + } } } } - if(commentCollapseButton_ == false){ // 可视区域中没有 [收起评论] 时(此时正在浏览评论内容 [头部区域] + [尾部区域](不上不下的,既看不到固定的 [收起评论] 又看不到悬浮的 [收起评论])),需要判断可视区域中是否存在评论元素 - for (let el of document.querySelectorAll('.NestComment')) { - if (isElementInViewport(el)) { - let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if (commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click() - break + if (commentCollapseButton_ == false) { // 可视区域中没有 [收起评论] 时(此时正在浏览评论内容 [头部区域] + [尾部区域](不上不下的,既看不到固定的 [收起评论] 又看不到悬浮的 [收起评论])),需要判断可视区域中是否存在评论元素 + let commentCollapseButton_1 = document.querySelectorAll('.NestComment') + if (commentCollapseButton_1.length > 0) { + for (let el of commentCollapseButton_1) { + if (isElementInViewport(el)) { + let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if (commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click() + break + } } } } @@ -257,333 +265,252 @@ function addEventListener_DOMNodeInserted() { function EventXMLHttpRequest() { var _send = window.XMLHttpRequest.prototype.send function sendReplacement(data) { - //console.log(`111111`); addTypeTips(); return _send.apply(this, arguments); } window.XMLHttpRequest.prototype.send = sendReplacement; } -/*(function (open) { - XMLHttpRequest.prototype.open = function () { - this.addEventListener("readystatechange", function () { - //console.log(this.responseURL); - }, false); - open.apply(this, arguments); - }; -})(XMLHttpRequest.prototype.open);*/ - - -// 置顶显示时间 - 首页,来自:https://greasyfork.org/scripts/402808 -function topTime_index() -{ - $(".TopstoryItem").each(function(){ - if( !($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length>0 && $(this).find(".ContentItem-time").find("span").text() != null) - { - // 完整显示时间 - if(menu_value('menu_allTime')) - { - if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip - { - let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); - var oldtext =$(this).find(".ContentItem-time").find("span").text(); - $(this).find(".ContentItem-time").find("span").text(data_tooltip+","+oldtext); - $(this).find(".ContentItem-time").addClass("full"); - } - else if($(this).find(".ContentItem-time").text().indexOf("发布于") > -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") == -1) //只有"发布于"时替换为具体发布时间data-tooltip - { - let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); - $(this).find(".ContentItem-time").find("span").text(data_tooltip); - $(this).find(".ContentItem-time").addClass("full"); - } - } - //发布时间置顶 - if(menu_value('menu_publishTop')) - { - if(!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) - { - let temp_time = $(this).find(".ContentItem-time").clone(); - $(this).find(".RichContent .ContentItem-time").hide(); - $(this).find(".ContentItem-meta").append(temp_time); - } - } +// [完整显示时间 + 置顶显示时间] 功能修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且优化了代码) +// 完整显示时间 + 置顶显示时间 - 首页 +function topTime_index() { + let topTime = document.querySelectorAll('.TopstoryItem');if (!topTime) return + topTime.forEach(function(_this) { + let ContentItemTime = _this.querySelector('.ContentItem-time');if (!ContentItemTime) return + if (!(ContentItemTime.classList.contains('full')) && ContentItemTime.querySelector('span') && ContentItemTime.querySelector('span').innerText != null) { + // 完整显示时间 + topTime_allTime(ContentItemTime) + // 发布时间置顶 + topTime_publishTop(ContentItemTime, _this, 'ContentItem-meta') } - }) } -// UTC 标准时转 UTC+8 北京时间,来自:https://greasyfork.org/zh-CN/scripts/402808 -function getUTC8 (datetime) { - let month = (datetime.getMonth() + 1) < 10 ? "0" + (datetime.getMonth() + 1) : (datetime.getMonth() + 1); - let date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate(); - let hours = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours(); - let minutes = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes(); - let seconds = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds(); - return (datetime.getFullYear() + "-" + month + "-" + date + "\xa0\xa0" + hours + ":" + minutes + ":" + seconds); +// 完整显示时间 + 置顶显示时间 - 回答页 +function topTime_question() { + let topTime = document.querySelectorAll('.ContentItem.AnswerItem');if (!topTime) return + topTime.forEach(function(_this) { + let ContentItemTime = _this.querySelector('.ContentItem-time');if (!ContentItemTime) return + if (!(ContentItemTime.classList.contains('full')) && ContentItemTime.querySelector('span') && ContentItemTime.querySelector('span').innerText != null) { + // 完整显示时间 + topTime_allTime(ContentItemTime) + // 发布时间置顶 + topTime_publishTop(ContentItemTime, _this, 'ContentItem-meta') + } + + }) + + // 问题创建时间 + if (!(document.querySelector('.QuestionPage .QuestionHeader-side p')) && window.location.href.indexOf("log") == -1) { // 没有执行过 且 非问题日志页 + let createtime = document.querySelector('.QuestionPage>[itemprop~=dateCreated]').getAttribute('content'); + let modifiedtime = document.querySelector('.QuestionPage>[itemprop~=dateModified]').getAttribute('content'); + createtime = getUTC8(new Date(createtime)); + modifiedtime = getUTC8(new Date(modifiedtime)); + // 添加到问题页右上角 + document.querySelector('.QuestionPage .QuestionHeader-side').insertAdjacentHTML('beforeEnd', '

    创建时间:  ' + createtime + '

    最后编辑:  ' + modifiedtime + '

    '); + } } -// 置顶显示时间 - 回答页,来自:https://greasyfork.org/scripts/402808 -function topTime_question() -{ - //回答的发布时间 - $(".ContentItem.AnswerItem").each(function(){ - if( !($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length>0 && $(this).find(".ContentItem-time").find("span").text() != null) - { +// 完整显示时间 + 置顶显示时间 - 搜索结果页 +function topTime_search() { + let topTime = document.querySelectorAll('.ContentItem.AnswerItem, .ContentItem.ArticleItem');if (!topTime) return + topTime.forEach(function(_this) { + let ContentItemTime = _this.querySelector('.ContentItem-time');if (!ContentItemTime) return + if (!(ContentItemTime.classList.contains('full')) && ContentItemTime.querySelector('span') && ContentItemTime.querySelector('span').innerText != null) { // 完整显示时间 - if(menu_value('menu_allTime')) - { - if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip - { - let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); - var oldtext =$(this).find(".ContentItem-time").find("span").text(); - $(this).find(".ContentItem-time").find("span").text(data_tooltip+","+oldtext); - $(this).find(".ContentItem-time").addClass("full"); - } - else if($(this).find(".ContentItem-time").text().indexOf("发布于") > -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") == -1) //只有"发布于"时替换为具体发布时间data-tooltip - { - let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); - $(this).find(".ContentItem-time").find("span").text(data_tooltip); - $(this).find(".ContentItem-time").addClass("full"); - } - } - - //发布时间置顶 - if(menu_value('menu_publishTop')) - { - if(!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) - { - let temp_time = $(this).find(".ContentItem-time").clone(); - $(this).find(".RichContent .ContentItem-time").hide(); - $(this).find(".ContentItem-meta").append(temp_time); - } - } + topTime_allTime(ContentItemTime) + // 发布时间置顶 + topTime_publishTop(ContentItemTime, _this, 'SearchItem-meta') } }) +} - $(".Pc-card.Card").attr("style","display:none") - //问题创建时间,来自:https://greasyfork.org/zh-CN/scripts/402808 - if ($(".QuestionPage .QuestionHeader-side p").length == 0 && window.location.href.indexOf("log") == -1) //非问题日志页 - { - let createtime = $(".QuestionPage>[itemprop~=dateCreated]").attr("content"); - let modifiedtime = $(".QuestionPage>[itemprop~=dateModified]").attr("content"); - createtime = getUTC8(new Date(createtime)); - modifiedtime = getUTC8(new Date(modifiedtime)); +// 完整显示时间 + 置顶显示时间 - 用户主页 +function topTime_people() { + let topTime = document.querySelectorAll('.ContentItem.AnswerItem, .ContentItem.ArticleItem');if (!topTime) return + topTime.forEach(function(_this) { + let ContentItemTime = _this.querySelector('.ContentItem-time');if (!ContentItemTime) return + if (!(ContentItemTime.classList.contains('full')) && ContentItemTime.querySelector('span') && ContentItemTime.querySelector('span').innerText != null) { + // 完整显示时间 + topTime_allTime(ContentItemTime) + // 发布时间置顶 + topTime_publishTop(ContentItemTime, _this, 'ContentItem-meta') + } - $(".QuestionPage .QuestionHeader-side").append('

    创建时间:  ' + createtime + '

    最后编辑:  ' + modifiedtime + '

    '); - } + }) } -// 置顶显示时间 - 专栏/文章,来自:https://greasyfork.org/scripts/402808 -function topTime_zhuanlan() -{ - //隐藏推荐文章 - $(".Recommendations-Main").hide(); +// 完整显示时间 + 置顶显示时间 - 专栏/文章 +function topTime_zhuanlan() { + let ContentItemTime = document.querySelector('.ContentItem-time');if (!ContentItemTime) return // 完整显示时间 - if(menu_value('menu_allTime')) - { - if( $(".ContentItem-time").text().indexOf("编辑于")>-1 && !$(".ContentItem-time").hasClass("done")) - { - let bianjiyu = $(".ContentItem-time").text(); - $(".ContentItem-time").click(); - $(".ContentItem-time").text($(".ContentItem-time").text()+","+bianjiyu) - $(".ContentItem-time").addClass("done"); + if (menu_value('menu_allTime')) { + if (ContentItemTime.innerText.indexOf('编辑于') > -1 && !(ContentItemTime.classList.contains('doneeeeee'))) { + let bianjiyu = ContentItemTime.innerText; + ContentItemTime.click(); + ContentItemTime.innerText = (ContentItemTime.innerText + "," + bianjiyu) + ContentItemTime.classList.add("doneeeeee"); } } //发布时间置顶 - if(menu_value('menu_publishTop') && $(".Post-Header").find(".ContentItem-time").length==0) - { - $(".ContentItem-time").css({"padding":"0px 0px 0px 0px","margin-top": "14px"}); - $(".ContentItem-time").appendTo($(".Post-Header")) + if (menu_value('menu_publishTop') && !(document.querySelector('.Post-Header > .ContentItem-time')) && !(document.querySelector('.ContentItem-meta > .ContentItem-time'))) { + ContentItemTime.style.cssText = 'padding:0px 0px 0px 0px; margin-top: 14px' + let temp_time = ContentItemTime.cloneNode(true); + // ContentItemTime.style.display = 'none'; + if (window.location.href.indexOf("column") > -1){ + document.querySelector('.ContentItem-meta').insertAdjacentElement('beforeEnd', temp_time); + } else { + document.querySelector('.Post-Header').insertAdjacentElement('beforeEnd', temp_time); + } } } -// 置顶显示时间 - 搜索结果页,来自:https://greasyfork.org/scripts/402808 -function topTime_search() -{ - $(".ContentItem.AnswerItem, .ContentItem.ArticleItem").each(function(){ - if( !($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length>0 && $(this).find(".ContentItem-time").find("span").text() != null) - { - // 完整显示时间 - if(menu_value('menu_allTime')) - { - if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时,增加具体发布时间data-tooltip - { - let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); - var oldtext =$(this).find(".ContentItem-time").find("span").text(); - $(this).find(".ContentItem-time").find("span").text(data_tooltip+","+oldtext); - $(this).find(".ContentItem-time").addClass("full"); - } - else if($(this).find(".ContentItem-time").text().indexOf("发布于") > -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") == -1) //只有"发布于"时替换为具体发布时间data-tooltip - { - let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); - $(this).find(".ContentItem-time").find("span").text(data_tooltip); - $(this).find(".ContentItem-time").addClass("full"); - } - } - //发布时间置顶 - if(menu_value('menu_publishTop')) - { - if(!$(this).find(".ContentItem-time").parent().hasClass("SearchItem-meta")) - { - let temp_time = $(this).find(".ContentItem-time").clone(); - $(this).find(".RichContent .ContentItem-time").hide(); - $(this).find(".SearchItem-meta").append(temp_time); - } - } +// 完整显示时间 +function topTime_allTime(ContentItemTime) { + if (menu_value('menu_allTime')) { + if (ContentItemTime.innerText.indexOf("发布于") == -1 && ContentItemTime.innerText.indexOf("编辑于") > -1) { //只有 "编辑于" 时增加具体发布时间 data-tooltip + let data_tooltip = ContentItemTime.querySelector('span').getAttribute('data-tooltip'); + let oldtext = ContentItemTime.querySelector('span').innerText; + ContentItemTime.querySelector('span').innerText = data_tooltip + "," + oldtext; + ContentItemTime.classList.add('full'); + } else if (ContentItemTime.innerText.indexOf("发布于") > -1 && ContentItemTime.innerText.indexOf("编辑于") == -1) { //只有 "发布于" 时替换为具体发布时间 data-tooltip + let data_tooltip = ContentItemTime.querySelector('span').getAttribute('data-tooltip'); + ContentItemTime.querySelector('span').innerText = data_tooltip; + ContentItemTime.classList.add('full'); } - - }) + } } -// 置顶显示时间 - 用户主页,来自:https://greasyfork.org/scripts/402808 -function topTime_people() -{ - $(".ContentItem.AnswerItem, .ContentItem.ArticleItem").each(function(){ - if( !($(this).find(".ContentItem-time").hasClass("full")) && $(this).find(".ContentItem-time").length>0 && $(this).find(".ContentItem-time").find("span").text() != null) - { - // 完整显示时间 - if(menu_value('menu_allTime')) - { - if($(this).find(".ContentItem-time").text().indexOf("发布于")==-1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") > -1) //只有"编辑于"时增加具体发布时间data-tooltip - { - let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); - var oldtext =$(this).find(".ContentItem-time").find("span").text(); - $(this).find(".ContentItem-time").find("span").text(data_tooltip+","+oldtext); - $(this).find(".ContentItem-time").addClass("full"); - } - else if($(this).find(".ContentItem-time").text().indexOf("发布于") > -1 && $(this).find(".ContentItem-time").text().indexOf("编辑于") == -1) //只有"发布于"时替换为具体发布时间data-tooltip - { - let data_tooltip = $(this).find(".ContentItem-time").find("span").attr("data-tooltip"); - $(this).find(".ContentItem-time").find("span").text(data_tooltip); - $(this).find(".ContentItem-time").addClass("full"); - } - } - //发布时间置顶 - if(menu_value('menu_publishTop')) - { - if(!$(this).find(".ContentItem-time").parent().hasClass("ContentItem-meta")) - { - let temp_time = $(this).find(".ContentItem-time").clone(); - $(this).find(".RichContent .ContentItem-time").hide(); - $(this).find(".ContentItem-meta").append(temp_time); - } - } +// 发布时间置顶 +function topTime_publishTop(ContentItemTime, _this, class_) { + if (menu_value('menu_publishTop')) { + if (!ContentItemTime.parentNode.classList.contains(class_)) { + let temp_time = ContentItemTime.cloneNode(true); + //_this.querySelector('.RichContent .ContentItem-time').style.display = 'none'; + _this.querySelector('.' + class_).insertAdjacentElement('beforeEnd', temp_time); } + } +} - }) + +// UTC 标准时转 UTC+8 北京时间,来自:https://greasyfork.org/zh-CN/scripts/402808 +function getUTC8(datetime) { + let month = (datetime.getMonth() + 1) < 10 ? "0" + (datetime.getMonth() + 1) : (datetime.getMonth() + 1); + let date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate(); + let hours = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours(); + let minutes = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes(); + let seconds = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds(); + return (datetime.getFullYear() + "-" + month + "-" + date + "\xa0\xa0" + hours + ":" + minutes + ":" + seconds); } -// 默认站外直链,来自:https://greasyfork.org/scripts/402808 + +// 默认站外直链,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript) function directLink () { - var equal, colon, external_href, protocol, path, new_href; - //文字链接 - $("a[class*=\'external\']").each(function () { - if ($(this).find("span").length > 0) { - new_href = $(this).text(); - $(this).attr("href", new_href); - } else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { - external_href = $(this).attr("href"); - new_href = external_href.substring(external_href = $(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); - //console.log(`${new_href}`) - $(this).attr("href", decodeURIComponent(new_href)); - } else { - external_href = $(this).attr("href"); - if (external_href.lastIndexOf("https%3A")) { - new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("https%3A")); - } else if (external_href.lastIndexOf("http%3A%2F%2F")) { - new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("http%3A")); + let link, equal, colon, externalHref, protocol, path, newHref; + // 文字链接 + link = document.querySelectorAll('a[class*="external"]') + if (link) { + link.forEach(function (_this) { + if (_this.getElementsByTagName('span').length > 0) { + newHref = _this.innerText; + _this.setAttribute('href', newHref); + } else if (_this.href.indexOf("link.zhihu.com/?target=") > -1) { + externalHref = _this.href; + newHref = externalHref.substring(externalHref = _this.href.indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); + _this.setAttribute('href', decodeURIComponent(newHref)); + } else { + externalHref = _this.href; + if (externalHref.lastIndexOf("https%3A")) { + newHref = _this.href.substring(_this.href.lastIndexOf("https%3A")); + } else if (externalHref.lastIndexOf("http%3A%2F%2F")) { + newHref = _this.href.substring(_this.href.lastIndexOf("http%3A")); + } + _this.setAttribute('href', decodeURIComponent(newHref)); } - $(this).attr("href", decodeURIComponent(new_href)); - } - }); - - //卡片链接 - $("a[class*=\'LinkCard\']:not([class*=\'MCNLinkCard\']):not([class*=\'ZVideoLinkCard\'])").each(function () { - if ($(this).find("LinkCard-title").length > 0 && $(this).find("LinkCard-title").indexOf("http") > -1) { - new_href = $(this).find("LinkCard-title").text(); - $(this).attr("href", new_href); - } else if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { - external_href = $(this).attr("href"); - new_href = external_href.substring(external_href = $(this).attr("href").indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); - $(this).attr("href", decodeURIComponent(new_href)); - } else { - external_href = $(this).attr("href"); - if (external_href.lastIndexOf("https%3A")) { - new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("https%3A")); - } else if (external_href.lastIndexOf("http%3A%2F%2F")) { - new_href = $(this).attr("href").substring($(this).attr("href").lastIndexOf("http%3A")); + }); + } + + // 卡片链接 + link = document.querySelectorAll('a[class*="LinkCard"]:not([class*="MCNLinkCard"]):not([class*="ZVideoLinkCard"])') + if (link) { + link.forEach(function (_this) { + if (_this.getElementsByTagName('LinkCard-title').length > 0 && _this.getElementsByTagName('LinkCard-title')[0].indexOf("http") > -1) { + newHref = _this.getElementsByTagName('LinkCard-title').innerText; + _this.setAttribute('href', newHref); + } else if (_this.href.indexOf("link.zhihu.com/?target=") > -1) { + externalHref = _this.href; + newHref = externalHref.substring(externalHref = _this.href.indexOf("link.zhihu.com/?target=") + "link.zhihu.com/?target=".length); + _this.setAttribute('href', decodeURIComponent(newHref)); + } else { + externalHref = _this.href; + if (externalHref.lastIndexOf("https%3A")) { + newHref = _this.href.substring(_this.href.lastIndexOf("https%3A")); + } else if (externalHref.lastIndexOf("http%3A%2F%2F")) { + newHref = _this.href.substring(_this.href.lastIndexOf("http%3A")); + } + _this.setAttribute('href', decodeURIComponent(newHref)); } - $(this).attr("href", decodeURIComponent(new_href)); - } - }); - - //旧版视频卡片链接 - $("a.VideoCard-link").each(function () { - if ($(this).attr("href").indexOf("link.zhihu.com/?target=") > -1) { - external_href = $(this).attr("href"); - equal = external_href.lastIndexOf("http"); - colon = external_href.lastIndexOf("%3A"); - protocol = external_href.substring(equal, colon); - path = external_href.substring(colon + 5, external_href.length); - new_href = protocol + "://" + path; - $(this).attr("href", decodeURIComponent(new_href)); - } - }); + }); + } - //隐藏首页广告卡片 - $(".TopstoryItem--advertCard").hide(); + // 旧版视频卡片链接 + link = document.querySelectorAll('a.VideoCard-link') + if (link) { + link.forEach(function (_this) { + if (_this.href.indexOf('link.zhihu.com/?target=') > -1) { + externalHref = _this.href; + equal = externalHref.lastIndexOf('http'); + colon = externalHref.lastIndexOf('%3A'); + protocol = externalHref.substring(equal, colon); + path = externalHref.substring(colon + 5, externalHref.length); + newHref = protocol + '://' + path; + _this.setAttribute('href', decodeURIComponent(newHref)); + } + }); + } } -// 默认高清原图,来自:https://greasyfork.org/scripts/402808 +// 默认高清原图,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript) function originalPic(){ - $("img").each(function(){ - if ($(this).attr("data-original")!=undefined && !$(this).hasClass("comment_sticker")) { - if ($(this).attr("src") != $(this).attr("data-original")) { - $(this).attr("src",$(this).attr("data-original")) + let pic = document.getElementsByTagName('img');if (!pic) return + Array.from(pic).forEach(function(pic1){ + if (pic1.getAttribute('data-original') != undefined && pic1.className != 'comment_sticker') { + if (pic1.getAttribute('src') != pic1.getAttribute('data-original')) { + pic1.setAttribute('src', pic1.getAttribute('data-original')) } } }) - $(".Modal-inner").css({"overflow-y":"hidden"}) } (function() { addEventListener_DOMNodeInserted(); // 监听 网页插入元素 事件 - // 默认折叠邀请,来自:https://greasyfork.org/scripts/402808 - let timer=setInterval(function(){ - if($(".QuestionInvitation-content").text().indexOf("更多推荐结果") > -1) - { - clearInterval(timer); - $(".QuestionInvitation-content").addClass("hide"); - $(".QuestionInvitation-content").hide(); - - $(".QuestionInvitation-title").html($(".QuestionInvitation-title").text()+' 展开/折叠') - - $(".Topbar").click(function(){ - - if(($(".QuestionInvitation-content").hasClass("hide"))) - { - $(".QuestionInvitation-content").removeClass("hide").addClass("show"); - $(".QuestionInvitation-content").show(); - } - else - { - $(".QuestionInvitation-content").removeClass("show").addClass("hide"); - $(".QuestionInvitation-content").hide(); - } - }) + // 默认折叠邀请,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript) + let timer = setInterval(function(){ + let QuestionInvitation = document.querySelector('.QuestionInvitation-content');if (!QuestionInvitation) return + clearInterval(timer); + QuestionInvitation.style.display = "none"; + document.querySelector('.QuestionInvitation-title').innerHTML = document.querySelector('.QuestionInvitation-title').innerText + ' 展开/折叠' + // 点击事件(展开/折叠) + document.querySelector('.Topbar').onclick = function(){ + let QuestionInvitation = document.querySelector('.QuestionInvitation-content') + if (QuestionInvitation.style.display == 'none') { + QuestionInvitation.style.display = '' + } else { + QuestionInvitation.style.display = 'none' + } } }) @@ -606,11 +533,11 @@ function originalPic(){ setInterval(topTime_search, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 }else if(window.location.href.indexOf("topic") > -1){ // 话题页 // - if(window.location.href.indexOf("unanswered") == -1){ + if(window.location.href.indexOf("hot") > -1 || window.location.href.indexOf("top-answers") > -1){ collapsedAnswer(); // 一键收起回答 collapsedNowAnswer("main.App-main"); collapsedNowAnswer(".ContentLayout"); - setInterval(topTime_search, 300); // 置顶显示时间 + setInterval(topTime_people, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 } }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // From 147d9390df86eb59180438f8d0f1fe1de22b3978 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 17:07:28 +0800 Subject: [PATCH 0160/2377] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20jQuery=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index aedb52c88..60f7dff0b 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -6,7 +6,6 @@ // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico -// @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab From 80f79e8342fd3b54e572abc2577d9d346b06efb5 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 17:32:24 +0800 Subject: [PATCH 0161/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E9=A1=B5=E4=BC=AA=E8=A3=85=E4=B8=BA=20Github=EF=BC=88?= =?UTF-8?q?=E6=91=B8=E9=B1=BC=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index f1c5ead43..056dfbaef 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name V2EX 增强 -// @version 1.0.3 +// @version 1.0.4 // @author X.I.U -// @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处) +// @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处)、标签页伪装为 Github(摸鱼) // @match *://v2ex.com/* // @match *://*.v2ex.com/* // @icon https://www.v2ex.com/static/favicon.ico @@ -23,7 +23,8 @@ ['menu_autoClockIn', '自动签到', '自动签到', true], ['menu_pageLoading', '自动无缝翻页', '自动无缝翻页', true], ['menu_pageLoading_reply', '帖子内自动翻页', '帖子内自动翻页', false], - ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true] + ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true], + ['menu_fish', '标签页伪装为 Github(摸鱼)', '标签页伪装为 Github', false] ], menu_ID = []; for (let i=0;i 0){ From e393f0ebf87a855c3e8c55f2918b825798eff27b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 19:50:20 +0800 Subject: [PATCH 0162/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E4=BD=99=E9=A2=9D=E9=A1=B5]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 48 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 056dfbaef..4cff44337 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name V2EX 增强 -// @version 1.0.4 +// @version 1.0.5 // @author X.I.U // @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处)、标签页伪装为 Github(摸鱼) // @match *://v2ex.com/* @@ -71,7 +71,7 @@ var curSite = {SiteTypeID: 0}; // 自动翻页规则 - // HT_insert:1 = 插入该元素的前面;2 = 插入该元素内的最后面 + // HT_insert:1 = 插入该元素本身的前面;2 = 插入该元素当中,第一个子元素前面;3 = 插入该元素当中,最后一个子元素后面;4 = 插入该元素本身的后面; // scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页),一般是访问网页速度越慢,该值就需要越大 let DBSite = { recent: { // 最近主题页 @@ -91,7 +91,7 @@ type: 1, nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', pageElement: 'css;#notifications > div', - HT_insert: ['css;#notifications', 2], + HT_insert: ['css;#notifications', 3], replaceE: 'css;#Main .box > .cell:not(.item) > table', scrollDelta: 600 } @@ -113,7 +113,7 @@ type: 1, nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', pageElement: 'css;#TopicsNode > div', - HT_insert: ['css;#TopicsNode', 2], + HT_insert: ['css;#TopicsNode', 3], replaceE: 'css;#Main .box > .cell:not(.item) > table', scrollDelta: 700 } @@ -135,21 +135,35 @@ type: 1, nextLink: '//a[@class="page_current"]/preceding-sibling::a[1][@href]', pageElement: 'css;.cell[id^="r_"]', - HT_insert: ['//div[starts-with(@id, "r_")][position()=1]', 1], + HT_insert: ['//div[starts-with(@id, "r_")][1]', 1], replaceE: 'css;#Main .box > .cell:not(.normalUser) > table', scrollDelta: 700 } + }, + balance: { // 账户余额页 + SiteTypeID: 7, + pager: { + type: 1, + nextLink: '//div[@id="Main"]//div[@class="cell"][last()]//a[@class="page_current"]/following-sibling::a[1][@href]', + pageElement: '//div[@id="Main"]//div[@class="cell"][last()]/preceding-sibling::div[1]//tr[position()>1]', + HT_insert: ['//div[@id="Main"]//div[@class="cell"][last()]/preceding-sibling::div[1]//tr[last()]', 4], + replaceE: 'css;#Main .box .cell[style] > table', + scrollDelta: 700 + } } }; switch (location.pathname) { - case "/recent": // 最近主题页 + case "/recent": // 最近主题页 curSite = DBSite.recent; break; case "/notifications": // 提醒消息页 curSite = DBSite.notifications; break; + case "/balance": // 账户余额页 + curSite = DBSite.balance; + break; default: if (location.pathname.indexOf('/go/') > -1) { // 分类主题页 curSite = DBSite.go; @@ -161,8 +175,8 @@ } curSite.pageUrl = ""; // 下一页URL - if(menu_value('menu_fish'))fish() // 标签页伪装为 Github(摸鱼) - if(menu_value('menu_autoClockIn'))setTimeout(qianDao, 1000) // 自动签到(后台),延迟 1 秒执行是为了兼容 [V2ex Plus] 扩展 + if(menu_value('menu_fish'))fish(); // 标签页伪装为 Github(摸鱼) + if(menu_value('menu_autoClockIn'))setTimeout(qianDao, 1000); // 自动签到(后台),延迟 1 秒执行是为了兼容 [V2ex Plus] 扩展 if(menu_value('menu_pageLoading'))pageLoading(); // 自动翻页(无缝) if(menu_value('menu_backToTop'))backToTop(); // 回到顶部(右键点击空白处) @@ -314,8 +328,22 @@ let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; if (pageElems.length >= 0) { - let addTo = "beforeend"; - if (curSite.pager.HT_insert[1] == 1) addTo = "beforebegin"; + // 插入位置 + let addTo; + switch (curSite.pager.HT_insert[1]) { + case 1: + addTo = "beforebegin" + break; + case 2: + addTo = "afterbegin" + break; + case 3: + addTo = "beforeend" + break; + case 4: + addTo = "afterend" + break; + } // 插入新页面元素 pageElems.forEach(function (one) { toElement.insertAdjacentElement(addTo, one); From 6c3f9ddd17a1a95f405243072ad91f5632bf04f9 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 20:16:10 +0800 Subject: [PATCH 0163/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5]=20=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 4cff44337..1b4a56ea6 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name V2EX 增强 -// @version 1.0.5 +// @version 1.0.6 // @author X.I.U // @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处)、标签页伪装为 Github(摸鱼) // @match *://v2ex.com/* @@ -81,7 +81,7 @@ nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', pageElement: 'css;.cell.item', HT_insert: ['//*[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], - replaceE: 'css;#Main .box .cell:not(.item) > table', + replaceE: 'css;#Main > .box > .cell[style]:not(.item) > table', scrollDelta: 600 } }, @@ -92,8 +92,8 @@ nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', pageElement: 'css;#notifications > div', HT_insert: ['css;#notifications', 3], - replaceE: 'css;#Main .box > .cell:not(.item) > table', - scrollDelta: 600 + replaceE: 'css;#Main > .box > .cell[style] > table', + scrollDelta: 1000 } }, replies: { // 用户回复页 @@ -103,7 +103,7 @@ nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', pageElement: '//*[@id="Main"]//div[@class="box"]//div[@class="dock_area"] | //*[@id="Main"]//div[@class="box"]//div[@class="inner"] | //*[@id="Main"]//div[@class="box"]//div[@class="dock_area"][last()]/following-sibling::div[@class="cell"][1]', HT_insert: ['//*[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], - replaceE: 'css;#Main .box .cell:not(.item) > table', + replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 1000 } }, @@ -114,7 +114,7 @@ nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', pageElement: 'css;#TopicsNode > div', HT_insert: ['css;#TopicsNode', 3], - replaceE: 'css;#Main .box > .cell:not(.item) > table', + replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 700 } }, @@ -125,7 +125,7 @@ nextLink: '//a[@class="page_current"]/preceding-sibling::a[1][@href]', pageElement: 'css;.cell[id^="r_"]', HT_insert: ['//div[starts-with(@id, "r_")][last()]/following-sibling::div[@class="cell"][1]', 1], - replaceE: 'css;#Main .box > .cell:not(.normalUser) > table', + replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 700 } }, @@ -136,7 +136,7 @@ nextLink: '//a[@class="page_current"]/preceding-sibling::a[1][@href]', pageElement: 'css;.cell[id^="r_"]', HT_insert: ['//div[starts-with(@id, "r_")][1]', 1], - replaceE: 'css;#Main .box > .cell:not(.normalUser) > table', + replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 700 } }, @@ -147,7 +147,7 @@ nextLink: '//div[@id="Main"]//div[@class="cell"][last()]//a[@class="page_current"]/following-sibling::a[1][@href]', pageElement: '//div[@id="Main"]//div[@class="cell"][last()]/preceding-sibling::div[1]//tr[position()>1]', HT_insert: ['//div[@id="Main"]//div[@class="cell"][last()]/preceding-sibling::div[1]//tr[last()]', 4], - replaceE: 'css;#Main .box .cell[style] > table', + replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 700 } } From a98c3020bf52946c2fc2544c2960411082f3614e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Apr 2021 20:20:18 +0800 Subject: [PATCH 0164/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5]=20=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 1b4a56ea6..e8572052a 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -80,7 +80,7 @@ type: 1, nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', pageElement: 'css;.cell.item', - HT_insert: ['//*[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], + HT_insert: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], replaceE: 'css;#Main > .box > .cell[style]:not(.item) > table', scrollDelta: 600 } @@ -101,8 +101,8 @@ pager: { type: 1, nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]', - pageElement: '//*[@id="Main"]//div[@class="box"]//div[@class="dock_area"] | //*[@id="Main"]//div[@class="box"]//div[@class="inner"] | //*[@id="Main"]//div[@class="box"]//div[@class="dock_area"][last()]/following-sibling::div[@class="cell"][1]', - HT_insert: ['//*[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], + pageElement: '//div[@id="Main"]//div[@class="box"]//div[@class="dock_area"] | //*[@id="Main"]//div[@class="box"]//div[@class="inner"] | //*[@id="Main"]//div[@class="box"]//div[@class="dock_area"][last()]/following-sibling::div[@class="cell"][1]', + HT_insert: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 1000 } From b771b71805097607a01be9e52015df46d0039d78 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 2 Apr 2021 11:36:12 +0800 Subject: [PATCH 0165/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E8=BD=AC=E5=9B=BE=E7=89=87=E3=80=81=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=EF=BC=88=E5=B7=A6=E9=94=AE=E5=8F=8C=E5=87=BB?= =?UTF-8?q?=E4=B8=A4=E4=BE=A7=E7=A9=BA=E7=99=BD=E5=A4=84=EF=BC=89]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 48 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index e8572052a..95f4f5e43 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name V2EX 增强 -// @version 1.0.6 +// @version 1.0.7 // @author X.I.U -// @description 自动签到、自动无缝翻页、回到顶部(右键点击两侧空白处)、标签页伪装为 Github(摸鱼) +// @description 自动签到、链接转图片、自动无缝翻页、回到顶部(右键点击两侧空白处)、快速回复(左键双击两侧空白处)、标签页伪装为 Github(摸鱼) // @match *://v2ex.com/* // @match *://*.v2ex.com/* // @icon https://www.v2ex.com/static/favicon.ico @@ -21,9 +21,11 @@ (function() { var menu_ALL = [ ['menu_autoClockIn', '自动签到', '自动签到', true], + ['menu_linksToImgs', '链接转图片', '链接转图片', true], ['menu_pageLoading', '自动无缝翻页', '自动无缝翻页', true], ['menu_pageLoading_reply', '帖子内自动翻页', '帖子内自动翻页', false], ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true], + ['menu_quickReply', '快速回复(左键双击两侧空白处)', '快速回复', true], ['menu_fish', '标签页伪装为 Github(摸鱼)', '标签页伪装为 Github', false] ], menu_ID = []; for (let i=0;i .content").oncontextmenu = function(event){ if (event.target==this) { @@ -231,6 +235,42 @@ } + // 链接转图片,修改自:https://greasyfork.org/scripts/14182 + function linksToImgs() { + let links = document.links; + Array.from(links).forEach(function (_this) { + if (/^https.*\.(?:jpg|jpeg|jpe|bmp|png|gif)/i.test(_this.href) && !(/`; + } + }); + } + + + // 快速回复(双击左右两侧空白处) + function quickReply() { + document.getElementById("Wrapper").ondblclick = document.querySelector("#Wrapper > .content").ondblclick = function(event){ + if (event.target==this) { + if (document.querySelector('.box.reply-box-sticky')) { + document.getElementById('undock-button').click(); + }else{ + let _top = document.body.scrollTop + document.documentElement.scrollTop; + document.getElementById('reply_content').focus(); + window.scrollTo(0,_top);console.log(_top); + } + } + } + //document.querySelector('div.topic_buttons').insertAdjacentHTML('beforeend', '快速回复'); + /*document.getElementById('reply_233').onclick = function () { + if (document.querySelector('.box.reply-box-sticky')) { + document.getElementById('undock-button').click(); + }else{ + let _top = document.body.scrollTop + document.documentElement.scrollTop; + document.getElementById('reply_content').focus(); + window.scrollTo(0,_top);console.log(_top); + } + }*/ + } + // 自动无缝翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ From b2e863c9c2765746613e56be8e4d8ff278092b5a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 2 Apr 2021 11:40:40 +0800 Subject: [PATCH 0166/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E8=BD=AC=E5=9B=BE=E7=89=87=E3=80=81=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=EF=BC=88=E5=B7=A6=E9=94=AE=E5=8F=8C=E5=87=BB?= =?UTF-8?q?=E4=B8=A4=E4=BE=A7=E7=A9=BA=E7=99=BD=E5=A4=84=EF=BC=89]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 95f4f5e43..0fe38a807 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -171,6 +171,7 @@ curSite = DBSite.go; } else if (location.pathname.indexOf('/t/') > -1) { // 帖子内容页 if(menu_value('menu_pageLoading_reply'))curSite = DBSite.reply_positive; // 帖子内自动无缝翻页 + if(menu_value('menu_quickReply'))quickReply(); // 快速回复(双击左右两侧空白处) } else if (location.pathname.indexOf('/replies') > -1) { // 用户回复页 curSite = DBSite.replies; } @@ -182,7 +183,6 @@ if(menu_value('menu_pageLoading'))pageLoading(); // 自动翻页(无缝) if(menu_value('menu_backToTop'))backToTop(); // 回到顶部(右键点击左右两侧空白处) if(menu_value('menu_linksToImgs'))linksToImgs(); // 链接转图片 - if(menu_value('menu_quickReply'))quickReply(); // 快速回复(双击左右两侧空白处) // 自动签到(后台) From 8ca1be613a52576f8699bd4cefc859aaf1595d37 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 2 Apr 2021 12:51:29 +0800 Subject: [PATCH 0167/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E5=AF=86=E7=A0=81=E5=90=8E=E5=9B=9E=E8=BD=A6=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 2c7a23278..7d8157283 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.2.2 +// @version 1.2.3 // @author X.I.U -// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、调整描述(话说)编辑框初始大小 +// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -82,12 +82,15 @@ } - if(document.getElementById("infos")){ // 分享链接文件列表页 + if (document.getElementById("infos")) { // 分享链接文件列表页 + if (document.getElementById("pwdload")) { // 分享链接输入密码页 + enterToPass(); // 输入密码后回车确认 + } setTimeout(fileMoreS, 300); // 自动显示更多文件 - }else if(document.querySelector("iframe.ifr2")){ // 分享链接文件下载页(暂时没有这方面的功能,先空着) + } else if (document.querySelector("iframe.ifr2")) { // 分享链接文件下载页(暂时没有这方面的功能,先空着) //console.log() - }else if(document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1){ // 后台页 - if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){ + } else if (document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1) { // 后台页 + if (window.top.location.href != "https://pc.woozooo.com/mydisk.php") { window.top.location.href = "https://pc.woozooo.com/mydisk.php" } var mainframe; @@ -326,6 +329,16 @@ } + // 输入密码后回车确认 + function enterToPass() { + document.getElementById('pwd').onkeydown = function(e){ + if(e.keyCode == 13){ + document.getElementById('sub').click(); + } + }; + } + + // 定时执行(旧方法,每隔 100ms 执行一次,比较笨且浪费一丢丢性能,但优点是不会漏掉且反应更快) //setInterval(fileMore,100); From 74e08e70d055b95a24a8d75860ba5f24823bf39a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 2 Apr 2021 17:08:23 +0800 Subject: [PATCH 0168/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 7434f7cef..c72839a29 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -34,8 +34,8 @@ // 自动翻页规则 // type:1 = 脚本实现自动无缝翻页,2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可,这时 nextText 为按钮文本,避免一瞬间加载太多次下一页 // HT_insert:1 = 插入该元素本身的前面;2 = 插入该元素当中,第一个子元素前面;3 = 插入该元素当中,最后一个子元素后面;4 = 插入该元素本身的后面; - // scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页) - // beforeFunction = 插入前执行函数;afterFunction = 插入后执行函数 + // scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页),一般是访问网页速度越慢,该值就需要越大 + // function:before = 插入前执行函数;after = 插入后执行函数;parameter = 参数 let DBSite = { _423down_postslist: { SiteTypeID: 1, @@ -67,8 +67,10 @@ pageElement: 'css;#index > article, #archive > article', HT_insert: ['css;ol.page-navigator', 1], replaceE: 'css;ol.page-navigator', - scrollDelta: 800, - beforeFunction: iao_su_postslist_beforeFunction + scrollDelta: 800 + }, + function: { + before: iao_su_postslist_beforeFunction } }, appinn_postslist: { @@ -90,8 +92,10 @@ pageElement: 'css;#postlist > div.entry', HT_insert: ['css;#postlist > .pagenavi-button', 1], replaceE: 'css;.pagenavi-button, .pagenavi', - scrollDelta: 1200, - beforeFunction: iplaysoft_postslist_beforeFunction + scrollDelta: 1200 + }, + function: { + before: iplaysoft_postslist_beforeFunction } }, iplaysoft_postcomments: { @@ -318,7 +322,7 @@ if (curSite.pager) { let curPageEle = getElementByXpath(curSite.pager.nextLink); var url = this.getFullHref(curPageEle); - console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); if(url === '') return; if(curSite.pageUrl === url) return;// 避免重复加载相同的页面 curSite.pageUrl = url; @@ -336,7 +340,13 @@ let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; if (pageElems.length >= 0) { // 如果有插入前函数就执行函数 - if (curSite.pager.beforeFunction)pageElems = curSite.pager.beforeFunction(pageElems); + if (curSite.function && curSite.function.before) { + if (curSite.function.parameter) { // 如果指定了参数 + pageElems = curSite.function.before(curSite.function.parameter); + }else{ + pageElems = curSite.function.before(pageElems); + } + } // 插入位置 let addTo; switch (curSite.pager.HT_insert[1]) { @@ -370,7 +380,13 @@ console.log(e); } // 如果有插入后函数就执行函数 - if (curSite.pager.afterFunction)curSite.pager.afterFunction(); + if (curSite.function && curSite.function.after) { + if (curSite.function.parameter) { // 如果指定了参数 + curSite.function.after(curSite.function.parameter); + }else{ + curSite.function.after(); + } + } } } catch (e) { console.log(e); From f8f6629777b2f91865ab2c3674cdff8412d42b41 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 2 Apr 2021 21:54:38 +0800 Subject: [PATCH 0169/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=9B=A0=20Gith?= =?UTF-8?q?ub=20=E6=9B=B4=E6=96=B0=E8=80=8C=E5=AF=BC=E8=87=B4=E7=9A=84=20[?= =?UTF-8?q?Release=E3=80=81Code(ZIP)]=20=E5=8A=A0=E9=80=9F=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 50 +++++++++++----------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 36f82726a..dca999c53 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.2 +// @version 1.4.3 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -109,14 +109,14 @@ let html = document.getElementsByClassName('Box Box--condensed');if (!html) return Array.from(html).forEach(function (current) { current.querySelectorAll('.d-flex.Box-body > a').forEach(function (_this) { - let href = _this.href, + let href = _this.href.split('github.com'), url = [ - download_url[0][0] + '/https://github.com' + href, - download_url[1][0] + '/https://github.com' + href, - download_url[2][0] + href, - download_url[3][0] + '/https://github.com' + href, - download_url[4][0] + '/https://github.com' + href, - download_url[5][0] + '/https://github.com' + href + download_url[0][0] + '/' + _this.href, + download_url[1][0] + '/' + _this.href, + download_url[2][0] + href[1], + download_url[3][0] + '/' + _this.href, + download_url[4][0] + '/' + _this.href, + download_url[5][0] + '/' + _this.href ], _html = `
    `; for (let i=0;i a').forEach(function (_this) { - let href = _this.href, + let href = _this.href.split('github.com'), url = [ - download_url[0][0] + '/https://github.com' + href, - download_url[1][0] + '/https://github.com' + href, - download_url[2][0] + href, - download_url[3][0] + '/https://github.com' + href, - download_url[4][0] + '/https://github.com' + href, - download_url[5][0] + '/https://github.com' + href + download_url[0][0] + '/' + _this.href, + download_url[1][0] + '/' + _this.href, + download_url[2][0] + href[1], + download_url[3][0] + '/' + _this.href, + download_url[4][0] + '/' + _this.href, + download_url[5][0] + '/' + _this.href ], _html = `
    `; for (let i=0;i Date: Fri, 2 Apr 2021 22:03:52 +0800 Subject: [PATCH 0170/2377] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=20[=E4=B8=AD=E5=9B=BD=E5=9B=BD=E5=86=85=2001?= =?UTF-8?q?]=20Raw=20=E5=8A=A0=E9=80=9F=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index dca999c53..1d981147d 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.3 +// @version 1.4.4 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -45,8 +45,7 @@ ], raw_url = [ ['https://raw.githubusercontent.com','Github 原生',''], - ['https://raw.sevencdn.com','中国国内 01',''], - ['https://cdn.jsdelivr.net','中国国内 02','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。'], + ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。'], ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。'], ['https://ghproxy.com','韩国首尔',''] ], @@ -200,10 +199,9 @@ let href = location.href.replace('https://github.com',''), href2 = href.replace('/blob/','/'), url = [ - raw_url[1][0] + href2, - raw_url[2][0] + "/gh" + href.replace('/blob/','@'), - raw_url[3][0] + href2, - raw_url[4][0] + "/" + raw_url[0][0] + href2 + raw_url[1][0] + "/gh" + href.replace('/blob/','@'), + raw_url[2][0] + href2, + raw_url[3][0] + "/" + raw_url[0][0] + href2 ], _html = ``; for (let i=0;i Date: Sat, 3 Apr 2021 10:09:32 +0800 Subject: [PATCH 0171/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=96=B0?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=89=93=E5=BC=80=E9=93=BE=E6=8E=A5?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD;=20=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0]=20=E5=8A=9F=E8=83=BD=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E5=9C=A8=E4=BB=BB=E6=84=8F=E9=A1=B5=E9=9D=A2=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 138 +++++++++++++++++++++++++++++++++++------- 1 file changed, 116 insertions(+), 22 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 0fe38a807..18c056866 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name V2EX 增强 -// @version 1.0.7 +// @version 1.0.8 // @author X.I.U -// @description 自动签到、链接转图片、自动无缝翻页、回到顶部(右键点击两侧空白处)、快速回复(左键双击两侧空白处)、标签页伪装为 Github(摸鱼) +// @description 自动签到、链接转图片、自动无缝翻页、回到顶部(右键点击两侧空白处)、快速回复(左键双击两侧空白处)、新标签页打开链接、标签页伪装为 Github(摸鱼) // @match *://v2ex.com/* // @match *://*.v2ex.com/* // @icon https://www.v2ex.com/static/favicon.ico @@ -26,6 +26,7 @@ ['menu_pageLoading_reply', '帖子内自动翻页', '帖子内自动翻页', false], ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true], ['menu_quickReply', '快速回复(左键双击两侧空白处)', '快速回复', true], + ['menu_linksBlank', '新标签页打开链接', '新标签页打开链接', true], ['menu_fish', '标签页伪装为 Github(摸鱼)', '标签页伪装为 Github', false] ], menu_ID = []; for (let i=0;i .box > .cell[style]:not(.item) > table', scrollDelta: 600 + }, + function: { + after: linksBlank, + parameter: '#Main a.topic-link:not([target])' } }, notifications: { // 提醒消息页 @@ -96,6 +102,10 @@ HT_insert: ['css;#notifications', 3], replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 1000 + }, + function: { + after: linksBlank, + parameter: '#Main a[href^="/t/"]:not([target])' } }, replies: { // 用户回复页 @@ -107,6 +117,10 @@ HT_insert: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 1000 + }, + function: { + after: linksBlank, + parameter: '#Main a[href^="/t/"]:not([target])' } }, go: { // 分类主题页 @@ -118,6 +132,10 @@ HT_insert: ['css;#TopicsNode', 3], replaceE: 'css;#Main > .box > .cell[style] > table', scrollDelta: 700 + }, + function: { + after: linksBlank, + parameter: '#Main a.topic-link:not([target])' } }, reply: { // 帖子内容页 @@ -157,11 +175,16 @@ switch (location.pathname) { + case "/": // 首页 + linksBlank('#Main a.topic-link:not([target])'); + break; case "/recent": // 最近主题页 curSite = DBSite.recent; + linksBlank('#Main a.topic-link:not([target])'); break; case "/notifications": // 提醒消息页 curSite = DBSite.notifications; + linksBlank('#Main a[href^="/t/"]:not([target])'); break; case "/balance": // 账户余额页 curSite = DBSite.balance; @@ -169,11 +192,14 @@ default: if (location.pathname.indexOf('/go/') > -1) { // 分类主题页 curSite = DBSite.go; + linksBlank('#Main a.topic-link:not([target])'); } else if (location.pathname.indexOf('/t/') > -1) { // 帖子内容页 if(menu_value('menu_pageLoading_reply'))curSite = DBSite.reply_positive; // 帖子内自动无缝翻页 if(menu_value('menu_quickReply'))quickReply(); // 快速回复(双击左右两侧空白处) + linksBlank('#Main .box .topic_content a:not([href^="/member"]):not([target])'); } else if (location.pathname.indexOf('/replies') > -1) { // 用户回复页 curSite = DBSite.replies; + linksBlank('#Main a[href^="/t/"]:not([target])'); } } @@ -187,29 +213,70 @@ // 自动签到(后台) function qianDao() { - let qiandao = document.querySelector('.box .inner a[href="/mission/daily"]'); - if (qiandao) { - let url = (location.origin + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector('div#Top .tools').innerHTML)[0]); - GM_xmlhttpRequest({ - url: url, - method: "GET", - timeout: 5000, - onload: function (response) { - let html = ShowPager.createDocumentByString(response.responseText); - console.log(html) - if (html.querySelector('li.fa.fa-ok-sign')) { - html = html.getElementById('Main').innerText.match(/已连续登录 (\d+?) 天/)[0]; - qiandao.innerText = `自动签到成功!${html}`; + let timeNow = new Date().getUTCFullYear() + "/" + (new Date().getUTCMonth() + 1) + "/" + new Date().getUTCDate() // 当前 UTC-0 时间(V2EX 按这个时间的) + if (location.pathname == '/') { // 在首页 + let qiandao = document.querySelector('.box .inner a[href="/mission/daily"]'); + if (qiandao) { // 如果找到了签到提示 + qianDao_(qiandao, timeNow); // 后台签到 + } else if (document.getElementById('gift_v2excellent')) { // 兼容 [V2ex Plus] 扩展 + document.getElementById('gift_v2excellent').click(); + GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较 + } else { // 都没有找到,说明已经签过到了 + console.log('已经签过到了。') + } + } else { // 不在首页 + let timeOld = GM_getValue('menu_clockInTime') + if (!timeOld || timeOld != timeNow) { + qianDaoStatus_(timeNow) // 后台获取签到状态(并判断是否需要签到) + } else { // 新旧签到时间一致 + console.log('已经签过到了。') + } + } + } + + + // 后台签到 + function qianDao_(qiandao, timeNow) { + let url = (location.origin + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector('div#Top .tools').innerHTML)[0]); + GM_xmlhttpRequest({ + url: url, + method: "GET", + timeout: 5000, + onload: function (response) { + let html = ShowPager.createDocumentByString(response.responseText); + if (html.querySelector('li.fa.fa-ok-sign')) { + html = html.getElementById('Main').innerText.match(/已连续登录 (\d+?) 天/)[0]; + GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较 + console.log('自动签到完成!') + if (qiandao) { + qiandao.innerText = `自动签到完成!${html}`; qiandao.href = '#'; - } else { - GM_notification({text: '自动签到失败!请联系作者解决!', timeout: 4000, onclick() {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/424246/feedback', {active: true,insert: true,setParent: true});}}); - qiandao.innerText = '自动签到失败!请尝试手动签到!'; } + } else { + GM_notification({text: '自动签到失败!请联系作者解决!', timeout: 4000, onclick() {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/424246/feedback', {active: true,insert: true,setParent: true});}}); + if (qiandao) qiandao.innerText = '自动签到失败!请尝试手动签到!'; } - }); - } else if (document.getElementById('gift_v2excellent')) { // 兼容 [V2ex Plus] 扩展 - document.getElementById('gift_v2excellent').click(); - } + } + }); + } + + + // 后台获取签到状态(并判断是否需要签到) + function qianDaoStatus_(timeNow) { + GM_xmlhttpRequest({ + url: 'https://www.v2ex.com/mission/daily', + method: "GET", + timeout: 5000, + onload: function (response) { + let html = ShowPager.createDocumentByString(response.responseText); + if (html.querySelector('input[value^="领取"]')) { // 还没有签到... + qianDao_(null, timeNow); // 后台签到 + } else { // 已经签到了... + console.log('已经签过到了。') + GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较 + } + } + }); } @@ -271,6 +338,17 @@ }*/ } + + // 新标签页打开链接 + function linksBlank(css) { + if (!menu_value('menu_linksBlank')) return + let links = document.querySelectorAll(css);if (!links) return + Array.from(links).forEach(function (_this) { + _this.target = '_blank' + }); + } + + // 自动无缝翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ @@ -368,6 +446,14 @@ let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; if (pageElems.length >= 0) { + // 如果有插入前函数就执行函数 + if (curSite.function && curSite.function.before) { + if (curSite.function.parameter) { // 如果指定了参数 + pageElems = curSite.function.before(curSite.function.parameter); + }else{ + pageElems = curSite.function.before(pageElems); + } + } // 插入位置 let addTo; switch (curSite.pager.HT_insert[1]) { @@ -400,6 +486,14 @@ } catch (e) { console.log(e); } + // 如果有插入后函数就执行函数 + if (curSite.function && curSite.function.after) { + if (curSite.function.parameter) { // 如果指定了参数 + curSite.function.after(curSite.function.parameter); + }else{ + curSite.function.after(); + } + } } } catch (e) { console.log(e); From 51b9c58688749fc491142ddcb80ab535b55e686d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 3 Apr 2021 22:37:48 +0800 Subject: [PATCH 0172/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E5=AF=BC=E8=AF=BB=E6=82=AC=E8=B5=8F=E8=B4=B4]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=9C=89=E6=BC=8F=E7=BD=91=E4=B9=8B=E9=B1=BC?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 106 ++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 56 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 119abfd3e..040f91858 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.5 +// @version 1.2.6 // @author X.I.U // @description 自动签到、自动无缝翻页、屏蔽导读悬赏贴(最新发表页) // @match *://www.52pojie.cn/* @@ -23,19 +23,19 @@ ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_delateReward', '屏蔽导读悬赏贴(最新发表)', '屏蔽导读悬赏贴', true] ], menu_ID = []; - for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 - for (let i=0;i menu_ALL.length) { // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i 0){ + if (curSite.SiteTypeID > 0) { windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; @@ -171,9 +171,9 @@ if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { if (curSite.pager.type === 1) { ShowPager.loadMorePage(); - }else{ + } else { let autopbn = document.querySelector(curSite.pager.nextLink); - if (autopbn && autopbn.innerText == curSite.pager.nextText){ // 如果正在加载,就不再点击 + if (autopbn && autopbn.innerText == curSite.pager.nextText) { // 如果正在加载,就不再点击 autopbn.click(); } } @@ -186,59 +186,53 @@ // 自动签到 /*function qianDao() { - if (menu_value('menu_autoClockIn')){ - let qiandao = document.querySelector('#um p:last-child a:first-child'); - if (qiandao && qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"){ - window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 - qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] - qiandao.href = "#" // 修改 URL 为 # - } + if (!menu_value('menu_autoClockIn')) return + let qiandao = document.querySelector('#um p:last-child a:first-child'); + if (qiandao && qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"){ + window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 + qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] + qiandao.href = "#" // 修改 URL 为 # } }*/ // 自动签到(后台) function qianDao() { - if (menu_value('menu_autoClockIn')) { - let qiandao = document.querySelector('#um a[href="home.php?mod=task&do=apply&id=2"]'); - if (qiandao){ - GM_xmlhttpRequest({ - url: qiandao.href, - method: "GET", - timeout: 5000, - onload: function (response) { - let html = ShowPager.createDocumentByString(response.responseText); - html = html.querySelector('#messagetext p') - if (html && html.innerText.indexOf("任务已完成") > -1) { - qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] - qiandao.href = "#" // 修改 URL 为 # - }else{ - GM_notification({text: '自动签到失败!请联系作者解决!', title: '吾爱破解论坛增强', timeout: 3000}); - } + if (!menu_value('menu_autoClockIn')) return + let qiandao = document.querySelector('#um a[href="home.php?mod=task&do=apply&id=2"]'); + if (qiandao) { + GM_xmlhttpRequest({ + url: qiandao.href, + method: "GET", + timeout: 5000, + onload: function (response) { + let html = ShowPager.createDocumentByString(response.responseText); + html = html.querySelector('#messagetext p') + if (html && html.innerText.indexOf("任务已完成") > -1) { + qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] + qiandao.href = "#" // 修改 URL 为 # + } else { + GM_notification({text: '自动签到失败!请联系作者解决!', title: '吾爱破解论坛增强', timeout: 3000}); } - }); - } + } + }); } } //屏蔽悬赏贴(导读-最新发表) - function delateReward(){ - if(patt_guide_newthread.test(location.search) && menu_value('menu_delateReward')){ - let table = document.querySelector("#threadlist > div.bm_c > table"), - tbodys = table.getElementsByTagName('tbody'), - arrs = []; - for (let i=0; i Date: Sun, 4 Apr 2021 02:29:37 +0800 Subject: [PATCH 0173/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Beautification.user.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index 8e02ac1d0..82d58387d 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -143,9 +143,7 @@ textarea#fastpostmessage { }`, style_Add = document.createElement('style'); style = style_2 - if (menu_value('menu_rule')) { - style += style_1; - } + if (menu_value('menu_rule')) style += style_1; style_Add.innerHTML = style; document.head.appendChild(style_Add); } From 8d3eda938a94e7c565f77e35dd0482799175e900 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 4 Apr 2021 22:59:40 +0800 Subject: [PATCH 0174/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E7=99=BE?= =?UTF-8?q?=E5=88=86=E6=B5=8F=E8=A7=88=E5=99=A8=E8=AE=BA=E5=9D=9B]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 78 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index c72839a29..a3a2894ff 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.7 +// @version 1.1.8 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、AlphaCoders、三国杀论坛、PubMed +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -12,8 +12,10 @@ // @match *://www.appinn.com/*/*/ // @match *://www.appinn.com/?s=* // @match *://www.iplaysoft.com/* +// @match *://www.pixiv.net/tags/*/* // @match *://*.alphacoders.com/* // @match *://club.sanguosha.com/* +// @match *://www.centbrowser.net/* // @match *://pubmed.ncbi.nlm.nih.gov/?term=* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest @@ -107,16 +109,16 @@ scrollDelta: 1200 } }, - sanguosha_forum: { + discuz_forum: { SiteTypeID: 7, pager: { type: 2, nextLink: '#autopbn', nextText: '下一页 »', - scrollDelta: 800 + scrollDelta: 1000 } }, - sanguosha_thread: { + discuz_thread: { SiteTypeID: 8, pager: { type: 1, @@ -124,10 +126,10 @@ pageElement: 'css;div#postlist > div[id^="post_"]', HT_insert: ['css;div#postlist', 3], replaceE: 'css;div.pg', - scrollDelta: 800 + scrollDelta: 1000 } }, - sanguosha_search: { + discuz_search: { SiteTypeID: 9, pager: { type: 1, @@ -135,7 +137,7 @@ pageElement: 'css;div#threadlist > ul', HT_insert: ['css;div#threadlist', 3], replaceE: 'css;div.pg', - scrollDelta: 800 + scrollDelta: 1000 } }, pubmed_postslist: { @@ -157,6 +159,17 @@ replaceE: '//div[@class="hidden-xs hidden-sm"]/..', scrollDelta: 1000 } + }, + pixiv_tags: { + SiteTypeID: 12, + pager: { + type: 1, + nextLink: '//nav[not(starts-with(@class,"sc-"))]//button/following-sibling::a[1][@href]', + pageElement: 'css;section > div > ul > li', + HT_insert: ['css;section > div > ul', 3], + replaceE: 'css;nav:not([class^="sc-"])', + scrollDelta: 1000 + } } }; @@ -175,25 +188,40 @@ curSite = DBSite.appinn_postslist; break; case "www.iplaysoft.com": - if(location.pathname.indexOf(".html") > -1 || location.pathname.indexOf("/p/") > -1){ // 文章内 + if (location.pathname.indexOf(".html") > -1 || location.pathname.indexOf("/p/") > -1) { // 文章内 curSite = DBSite.iplaysoft_postcomments; - }else{ // 其他页面 + } else { // 其他页面 curSite = DBSite.iplaysoft_postslist; } break; + case "www.pixiv.net": + curSite = DBSite.pixiv_tags; + break; case "wall.alphacoders.com": case "avatars.alphacoders.com": case "mobile.alphacoders.com": curSite = DBSite.wall_alphacoders; break; - case "club.sanguosha.com": - if(location.pathname.indexOf("forum") > -1){ // 各版块帖子列表 - curSite = DBSite.sanguosha_forum; - }else if(location.pathname.indexOf("thread") > -1){ // 帖子内 - curSite = DBSite.sanguosha_thread; - hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 - }else if(location.pathname.indexOf("search") > -1){ // 搜索结果 - curSite = DBSite.sanguosha_search; + case "club.sanguosha.com": // Discuz! 论坛专用 + case "www.centbrowser.net": + if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾) + if (location.pathname.indexOf('forum') > -1) { // 各版块帖子列表 + curSite = DBSite.discuz_forum; + } else if (location.pathname.indexOf('thread') > -1) { // 帖子内 + curSite = DBSite.discuz_thread; + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + }else if(location.pathname.indexOf('search') > -1) { // 搜索结果 + curSite = DBSite.discuz_search; + } + } else { + if (location.search.indexOf('mod=forumdisplay') > -1) { // 各版块帖子列表 + curSite = DBSite.discuz_forum; + } else if (location.search.indexOf('mod=viewthread') > -1) { // 帖子内 + curSite = DBSite.discuz_thread; + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + } else if (location.pathname.indexOf('search') > -1) { // 搜索结果 + curSite = DBSite.discuz_search; + } } break; case "pubmed.ncbi.nlm.nih.gov": @@ -206,7 +234,7 @@ // 自动无缝翻页 function pageLoading() { - if (curSite.SiteTypeID > 0){ + if (curSite.SiteTypeID > 0) { windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; @@ -214,12 +242,12 @@ if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { if (curSite.pager.type === 1) { ShowPager.loadMorePage(); - }else{ + } else { let autopbn = document.querySelector(curSite.pager.nextLink); - if (autopbn){ // 如果正在加载,就不再点击 - if (!curSite.pager.nextText){ // 如果没有指定 nextText 就直接点击 + if (autopbn) { // 如果正在加载,就不再点击 + if (!curSite.pager.nextText) { // 如果没有指定 nextText 就直接点击 autopbn.click(); - }else if (autopbn.innerText.indexOf(curSite.pager.nextText) > -1){ // 如果指定了 nextText 就需要判断后再点击(避免已经在加载了,还重复点击) + } else if (autopbn.innerText.indexOf(curSite.pager.nextText) > -1){ // 如果指定了 nextText 就需要判断后再点击(避免已经在加载了,还重复点击) autopbn.click(); } } @@ -232,7 +260,7 @@ // 隐藏帖子内的 [下一页] 按钮 - function hidePgbtn(){ + function hidePgbtn() { let style_hidePgbtn = document.createElement('style'); style_hidePgbtn.innerHTML = `.pgbtn {display: none;}`; document.head.appendChild(style_hidePgbtn); @@ -334,7 +362,7 @@ timeout: 5000, onload: function (response) { try { - //console.log(`${response.responseText}`) + console.log(`${response.responseText}`) var newBody = ShowPager.createDocumentByString(response.responseText); let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; From 56937efda32d2a712e7f73e502b5536e4489e4db Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 5 Apr 2021 09:22:59 +0800 Subject: [PATCH 0175/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 18c056866..24871024f 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -222,14 +222,14 @@ document.getElementById('gift_v2excellent').click(); GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较 } else { // 都没有找到,说明已经签过到了 - console.log('已经签过到了。') + console.info('[V2EX 增强] 已经签过到了。') } } else { // 不在首页 let timeOld = GM_getValue('menu_clockInTime') if (!timeOld || timeOld != timeNow) { qianDaoStatus_(timeNow) // 后台获取签到状态(并判断是否需要签到) } else { // 新旧签到时间一致 - console.log('已经签过到了。') + console.info('[V2EX 增强] 已经签过到了。') } } } @@ -247,13 +247,14 @@ if (html.querySelector('li.fa.fa-ok-sign')) { html = html.getElementById('Main').innerText.match(/已连续登录 (\d+?) 天/)[0]; GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较 - console.log('自动签到完成!') + console.info('[V2EX 增强] 自动签到完成!') if (qiandao) { qiandao.innerText = `自动签到完成!${html}`; qiandao.href = '#'; } } else { GM_notification({text: '自动签到失败!请联系作者解决!', timeout: 4000, onclick() {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/424246/feedback', {active: true,insert: true,setParent: true});}}); + console.warn('[V2EX 增强] 自动签到失败!请联系作者解决!') if (qiandao) qiandao.innerText = '自动签到失败!请尝试手动签到!'; } } @@ -272,7 +273,7 @@ if (html.querySelector('input[value^="领取"]')) { // 还没有签到... qianDao_(null, timeNow); // 后台签到 } else { // 已经签到了... - console.log('已经签过到了。') + console.info('[V2EX 增强] 已经签过到了。') GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较 } } From dbd59ed183d54d1e01ae49dd15684c24e5e5a4ef Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 5 Apr 2021 09:45:39 +0800 Subject: [PATCH 0176/2377] README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 834da5477..def2d22ad 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![GitHub license](https://img.shields.io/github/license/XIU2/UserScript.svg?style=flat-square&color=4285dd)](https://github.com/XIU2/UserScript/blob/master/LICENSE) [![GitHub Star](https://img.shields.io/github/stars/XIU2/UserScript.svg?style=flat-square&label=Star&color=4285dd)](https://github.com/XIU2/UserScript/stargazers) [![GitHub Fork](https://img.shields.io/github/forks/XIU2/UserScript.svg?style=flat-square&label=Fork&color=4285dd)](https://github.com/XIU2/UserScript/network/members) +[![](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/457025-x-i-u) 🔨 自用的一些乱七八糟油猴脚本,**有什么需求、建议、问题直接提 [Issues](https://github.com/XIU2/UserScript/issues/new/choose)**,觉得**好用请点个⭐鼓励一下下~** From cbe1dcc70e3555ccd97fd579b802e976c8f7094f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 5 Apr 2021 09:56:47 +0800 Subject: [PATCH 0177/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 2 +- 52pojie-Beautification.user.js | 2 +- 52pojie-Enhanced.user.js | 2 +- GithubEnhanced-High-Speed-Download.user.js | 2 +- Hostloc-Enhanced.user.js | 2 +- Lanzou-Enhanced.user.js | 2 +- Zhihu-Beautification.user.js | 2 +- Zhihu-Enhanced.user.js | 291 ++++++++++----------- Zhiyoo-Enhanced.user.js | 2 +- 9 files changed, 151 insertions(+), 156 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 922d3d5cb..ba5c63baf 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -40,7 +40,7 @@ menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412890/feedback', {active: true,insert: true,setParent: true});}); } // 菜单开关 diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index 82d58387d..a95761caa 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -37,7 +37,7 @@ menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412681/feedback', {active: true,insert: true,setParent: true});}); } // 菜单开关 diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 040f91858..59b56fbc5 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -39,7 +39,7 @@ menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412680/feedback', {active: true,insert: true,setParent: true});}); } // 菜单开关 diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 1d981147d..acb6d872b 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -71,7 +71,7 @@ menu_raw_fast = 0 } menu_menu_raw_fast_ID = GM_registerMenuCommand(`🔄 [ ${raw_url[menu_raw_fast][1]} ] 加速源 (☁) - 点击切换`, menu_toggle_raw_fast); - menu_feedBack_ID = GM_registerMenuCommand('💬 反馈 & 建议 [Github]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript', {active: true,insert: true,setParent: true});}); + menu_feedBack_ID = GM_registerMenuCommand('💬 反馈 & 建议 [Github]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412245/feedback', {active: true,insert: true,setParent: true});}); } // 切换加速源 diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 2451c3ceb..0963e194a 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -38,7 +38,7 @@ menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/414005/feedback', {active: true,insert: true,setParent: true});}); } // 菜单开关 diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 7d8157283..475eec5af 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -55,7 +55,7 @@ menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419224/feedback', {active: true,insert: true,setParent: true});}); } // 菜单开关 diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 93cd9c94b..9694b030d 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -41,7 +41,7 @@ menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412212/feedback', {active: true,insert: true,setParent: true});}); } // 菜单开关 diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 60f7dff0b..08d4a6616 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -42,7 +42,7 @@ function registerMenuCommand() { menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419081/feedback', {active: true,insert: true,setParent: true});}); } @@ -70,90 +70,88 @@ function menu_value(menuName) { // 一键收起回答 -function collapsedAnswer(){ - if(menu_value('menu_collapsedAnswer')){ - let button_Add = `` - let style_Add = document.createElement('style'); - style_Add.innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; - document.head.appendChild(style_Add); - document.querySelector('.CornerAnimayedFlex').insertAdjacentHTML('afterBegin', button_Add); - document.getElementById('collapsed-button').onclick = function () { - document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { - if (el.hasAttribute('data-zop-retract-question')) { - el.click() - } - }); - } +function collapsedAnswer() { + if (!menu_value('menu_collapsedAnswer')) return + let button_Add = `` + let style_Add = document.createElement('style'); + style_Add.innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; + document.head.appendChild(style_Add); + document.querySelector('.CornerAnimayedFlex').insertAdjacentHTML('afterBegin', button_Add); + document.getElementById('collapsed-button').onclick = function () { + document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { + if (el.hasAttribute('data-zop-retract-question')) { + el.click() + } + }); } } // 收起当前回答、评论(监听点击事件,点击网页两侧空白处) -function collapsedNowAnswer(selectors){ - backToTop(selectors) - if (menu_value('menu_collapsedNowAnswer')) { - document.querySelector(selectors).onclick = function(event){ - if (event.target==this) { - let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') - if (rightButton) { // 悬浮的 [收起回答](此时正在浏览回答内容 [头部区域 + 中间区域]) - // 固定的 [收起评论](先看看是否展开评论) - let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if (commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click(); - } - // 再去收起回答 - rightButton = rightButton.querySelector('.ContentItem-rightButton') - if (rightButton && rightButton.hasAttribute('data-zop-retract-question')) { - rightButton.click(); +function collapsedNowAnswer(selectors) { + backToTop(selectors) // 快捷回到顶部 + if (!menu_value('menu_collapsedNowAnswer')) return + document.querySelector(selectors).onclick = function(event){ + if (event.target==this) { + let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') + if (rightButton) { // 悬浮的 [收起回答](此时正在浏览回答内容 [头部区域 + 中间区域]) + // 固定的 [收起评论](先看看是否展开评论) + let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if (commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click(); + } + // 再去收起回答 + rightButton = rightButton.querySelector('.ContentItem-rightButton') + if (rightButton && rightButton.hasAttribute('data-zop-retract-question')) { + rightButton.click(); + } + } else { // 固定的 [收起回答](此时正在浏览回答内容 [尾部区域]) + for (let el of document.querySelectorAll('.ContentItem-rightButton')) { + if (el.hasAttribute('data-zop-retract-question')) { + if (isElementInViewport(el)) { + // 固定的 [收起评论](先看看是否展开评论) + let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if (commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click(); + } + el.click() // 再去收起回答 + break + } } - } else { // 固定的 [收起回答](此时正在浏览回答内容 [尾部区域]) - for (let el of document.querySelectorAll('.ContentItem-rightButton')) { - if (el.hasAttribute('data-zop-retract-question')) { + } + } + + var commentCollapseButton_ = false; + // 悬浮的 [收起评论](此时正在浏览评论内容 [中间区域]) + let commentCollapseButton = document.querySelector('.CommentCollapseButton') + if (commentCollapseButton) { + commentCollapseButton.click(); + } else { // 固定的 [收起评论](此时正在浏览评论内容 [头部区域]) + let commentCollapseButton_1 = document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if (commentCollapseButton_1.length > 0) { + for (let el of commentCollapseButton_1) { + if (el.innerText.indexOf("收起评论") > -1) { if (isElementInViewport(el)) { - // 固定的 [收起评论](先看看是否展开评论) - let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if (commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click(); - } - el.click() // 再去收起回答 + el.click() + commentCollapseButton_ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 [收起评论] 时) break } } } } - - var commentCollapseButton_ = false; - // 悬浮的 [收起评论](此时正在浏览评论内容 [中间区域]) - let commentCollapseButton = document.querySelector('.CommentCollapseButton') - if (commentCollapseButton) { - commentCollapseButton.click(); - } else { // 固定的 [收起评论](此时正在浏览评论内容 [头部区域]) - let commentCollapseButton_1 = document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if (commentCollapseButton_ == false) { // 可视区域中没有 [收起评论] 时(此时正在浏览评论内容 [头部区域] + [尾部区域](不上不下的,既看不到固定的 [收起评论] 又看不到悬浮的 [收起评论])),需要判断可视区域中是否存在评论元素 + let commentCollapseButton_1 = document.querySelectorAll('.NestComment') if (commentCollapseButton_1.length > 0) { for (let el of commentCollapseButton_1) { - if (el.innerText.indexOf("收起评论") > -1) { - if (isElementInViewport(el)) { - el.click() - commentCollapseButton_ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 [收起评论] 时) + if (isElementInViewport(el)) { + let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + if (commentCollapseButton.innerText.indexOf("收起评论") > -1) { + commentCollapseButton.click() break } } } } - if (commentCollapseButton_ == false) { // 可视区域中没有 [收起评论] 时(此时正在浏览评论内容 [头部区域] + [尾部区域](不上不下的,既看不到固定的 [收起评论] 又看不到悬浮的 [收起评论])),需要判断可视区域中是否存在评论元素 - let commentCollapseButton_1 = document.querySelectorAll('.NestComment') - if (commentCollapseButton_1.length > 0) { - for (let el of commentCollapseButton_1) { - if (isElementInViewport(el)) { - let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if (commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click() - break - } - } - } - } - } } } } @@ -162,13 +160,12 @@ function collapsedNowAnswer(selectors){ // 回到顶部(监听点击事件,鼠标右键点击网页两侧空白处) -function backToTop(selectors){ - if(menu_value('menu_backToTop')){ - document.querySelector(selectors).oncontextmenu = function(event){ - if (event.target==this) { - event.preventDefault(); - window.scrollTo(0,0) - } +function backToTop(selectors) { + if (!menu_value('menu_backToTop')) return + document.querySelector(selectors).oncontextmenu = function(event){ + if (event.target==this) { + event.preventDefault(); + window.scrollTo(0,0) } } } @@ -191,32 +188,31 @@ function isElementInViewport(el) { var postNum; // 区分问题文章 function addTypeTips() { - if(menu_value('menu_typeTips')){ - // URL 匹配正则表达式 - let patt_zhuanlan = /zhuanlan.zhihu.com/, - patt_question = /question\/\d+/, - patt_question_answer = /answer\/\d+/, - patt_video = /\/zvideo\//, - patt_tip = /zhihu_e_tips/ - let postList = document.querySelectorAll('h2.ContentItem-title a'); - postNum = document.querySelectorAll('small.zhihu_e_tips'); - //console.log(`${postList.length} ${postNum.length}`) - if (postList.length > postNum.length){ - for(let num = postNum.length;num文章 ` + postList[num].innerHTML - }else if (patt_question.test(postList[num].href)){ // 如果是问题 - if (patt_question_answer.test(postList[num].href)){ // 如果是指向回答的问题(而非指向纯问题的链接) - postList[num].innerHTML = `问题 ` + postList[num].innerHTML - }else{ - postList[num].innerHTML = `问题 ` + postList[num].innerHTML - } - }else if (patt_video.test(postList[num].href)){ // 如果是视频 - postList[num].innerHTML = `视频 ` + postList[num].innerHTML + if (!menu_value('menu_typeTips')) return + // URL 匹配正则表达式 + let patt_zhuanlan = /zhuanlan.zhihu.com/, + patt_question = /question\/\d+/, + patt_question_answer = /answer\/\d+/, + patt_video = /\/zvideo\//, + patt_tip = /zhihu_e_tips/ + let postList = document.querySelectorAll('h2.ContentItem-title a'); + postNum = document.querySelectorAll('small.zhihu_e_tips'); + //console.log(`${postList.length} ${postNum.length}`) + if (postList.length > postNum.length) { + for (let num = postNum.length;num文章 ` + postList[num].innerHTML + } else if (patt_question.test(postList[num].href)) { // 如果是问题 + if (patt_question_answer.test(postList[num].href)) { // 如果是指向回答的问题(而非指向纯问题的链接) + postList[num].innerHTML = `问题 ` + postList[num].innerHTML + } else { + postList[num].innerHTML = `问题 ` + postList[num].innerHTML } - //postNum += 1; + } else if (patt_video.test(postList[num].href)) { // 如果是视频 + postList[num].innerHTML = `视频 ` + postList[num].innerHTML } + //postNum += 1; } } } @@ -284,7 +280,7 @@ function topTime_index() { // 发布时间置顶 topTime_publishTop(ContentItemTime, _this, 'ContentItem-meta') } - }) + }); } @@ -300,7 +296,7 @@ function topTime_question() { topTime_publishTop(ContentItemTime, _this, 'ContentItem-meta') } - }) + }); // 问题创建时间 if (!(document.querySelector('.QuestionPage .QuestionHeader-side p')) && window.location.href.indexOf("log") == -1) { // 没有执行过 且 非问题日志页 @@ -326,7 +322,7 @@ function topTime_search() { topTime_publishTop(ContentItemTime, _this, 'SearchItem-meta') } - }) + }); } @@ -342,7 +338,7 @@ function topTime_people() { topTime_publishTop(ContentItemTime, _this, 'ContentItem-meta') } - }) + }); } @@ -375,29 +371,27 @@ function topTime_zhuanlan() { // 完整显示时间 function topTime_allTime(ContentItemTime) { - if (menu_value('menu_allTime')) { - if (ContentItemTime.innerText.indexOf("发布于") == -1 && ContentItemTime.innerText.indexOf("编辑于") > -1) { //只有 "编辑于" 时增加具体发布时间 data-tooltip - let data_tooltip = ContentItemTime.querySelector('span').getAttribute('data-tooltip'); - let oldtext = ContentItemTime.querySelector('span').innerText; - ContentItemTime.querySelector('span').innerText = data_tooltip + "," + oldtext; - ContentItemTime.classList.add('full'); - } else if (ContentItemTime.innerText.indexOf("发布于") > -1 && ContentItemTime.innerText.indexOf("编辑于") == -1) { //只有 "发布于" 时替换为具体发布时间 data-tooltip - let data_tooltip = ContentItemTime.querySelector('span').getAttribute('data-tooltip'); - ContentItemTime.querySelector('span').innerText = data_tooltip; - ContentItemTime.classList.add('full'); - } + if (!menu_value('menu_allTime')) return + if (ContentItemTime.innerText.indexOf("发布于") == -1 && ContentItemTime.innerText.indexOf("编辑于") > -1) { //只有 "编辑于" 时增加具体发布时间 data-tooltip + let data_tooltip = ContentItemTime.querySelector('span').getAttribute('data-tooltip'); + let oldtext = ContentItemTime.querySelector('span').innerText; + ContentItemTime.querySelector('span').innerText = data_tooltip + "," + oldtext; + ContentItemTime.classList.add('full'); + } else if (ContentItemTime.innerText.indexOf("发布于") > -1 && ContentItemTime.innerText.indexOf("编辑于") == -1) { //只有 "发布于" 时替换为具体发布时间 data-tooltip + let data_tooltip = ContentItemTime.querySelector('span').getAttribute('data-tooltip'); + ContentItemTime.querySelector('span').innerText = data_tooltip; + ContentItemTime.classList.add('full'); } } // 发布时间置顶 function topTime_publishTop(ContentItemTime, _this, class_) { - if (menu_value('menu_publishTop')) { - if (!ContentItemTime.parentNode.classList.contains(class_)) { - let temp_time = ContentItemTime.cloneNode(true); - //_this.querySelector('.RichContent .ContentItem-time').style.display = 'none'; - _this.querySelector('.' + class_).insertAdjacentElement('beforeEnd', temp_time); - } + if (!menu_value('menu_publishTop')) return + if (!ContentItemTime.parentNode.classList.contains(class_)) { + let temp_time = ContentItemTime.cloneNode(true); + //_this.querySelector('.RichContent .ContentItem-time').style.display = 'none'; + _this.querySelector('.' + class_).insertAdjacentElement('beforeEnd', temp_time); } } @@ -489,14 +483,12 @@ function originalPic(){ pic1.setAttribute('src', pic1.getAttribute('data-original')) } } - }) + }); } -(function() { - addEventListener_DOMNodeInserted(); // 监听 网页插入元素 事件 - - // 默认折叠邀请,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript) +// 默认折叠邀请,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript) +function questionInvitation(){ let timer = setInterval(function(){ let QuestionInvitation = document.querySelector('.QuestionInvitation-content');if (!QuestionInvitation) return clearInterval(timer); @@ -511,51 +503,54 @@ function originalPic(){ QuestionInvitation.style.display = 'none' } } - }) + }); +} +(function() { + addEventListener_DOMNodeInserted(); // 监听 网页插入元素 事件 + questionInvitation(); // 默认折叠邀请 setInterval(originalPic,100); // 默认高清原图 - if(menu_value('menu_directLink')) setInterval(directLink, 100); // 默认站外直链 - + if (menu_value('menu_directLink')) setInterval(directLink, 100); // 默认站外直链 - if(window.location.href.indexOf("question") > -1){ // 回答页 // - if(window.location.href.indexOf("waiting") == -1){ + if (window.location.href.indexOf("question") > -1) { // 回答页 // + if (window.location.href.indexOf("waiting") == -1) { collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer(".QuestionPage"); - collapsedNowAnswer(".Question-main"); + collapsedNowAnswer(".QuestionPage"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".Question-main"); // 收起当前回答 + 快捷返回顶部 } setInterval(topTime_question, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("search") > -1){ // 搜索结果页 // + } else if (window.location.href.indexOf("search") > -1) { // 搜索结果页 // collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main div"); - collapsedNowAnswer(".Search-container"); + collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".Search-container"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_search, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 - }else if(window.location.href.indexOf("topic") > -1){ // 话题页 // - if(window.location.href.indexOf("hot") > -1 || window.location.href.indexOf("top-answers") > -1){ + } else if (window.location.href.indexOf("topic") > -1) { // 话题页 // + if (window.location.href.indexOf("hot") > -1 || window.location.href.indexOf("top-answers") > -1) { // 仅限 [讨论] [精华] collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main.App-main"); - collapsedNowAnswer(".ContentLayout"); + collapsedNowAnswer("main.App-main"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".ContentLayout"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_people, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 } - }else if(window.location.href.indexOf("zhuanlan") > -1){ // 文章 // - backToTop("article.Post-Main.Post-NormalMain") - backToTop("div.Post-Sub.Post-NormalSub") + } else if (window.location.href.indexOf("zhuanlan") > -1){ // 文章 // + backToTop("article.Post-Main.Post-NormalMain"); // 快捷返回顶部 + backToTop("div.Post-Sub.Post-NormalSub"); // 快捷返回顶部 setInterval(topTime_zhuanlan, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("column") > -1){ // 专栏 // + } else if (window.location.href.indexOf("column") > -1) { // 专栏 // collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main div"); + collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_zhuanlan, 300); // 置顶显示时间 - }else if(window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1){ // 用户主页 // + } else if (window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1) { // 用户主页 // collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main div"); - collapsedNowAnswer(".Profile-main"); + collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".Profile-main"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_people, 300); // 置顶显示时间 - }else{ // 首页 // + } else { // 首页 // collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main div"); - collapsedNowAnswer(".Topstory-container"); + collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".Topstory-container"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_index, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 } diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 2b37946d7..db22ec92f 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -47,7 +47,7 @@ menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } } - menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); + menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412362/feedback', {active: true,insert: true,setParent: true});}); } // 菜单开关 From 8be1546cf4570f8a8247e6e368ea18b8c980b2ab Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 5 Apr 2021 10:37:44 +0800 Subject: [PATCH 0178/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=85=A8?= =?UTF-8?q?=E7=AB=99=E6=9C=80=E8=BF=91=E6=9B=B4=E6=96=B0=E4=B8=BB=E9=A2=98?= =?UTF-8?q?];=20=E4=BC=98=E5=8C=96=20=E8=87=AA=E5=8A=A8=E6=97=A0=E7=BC=9D?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E6=95=8F=E6=84=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 24871024f..45f4c8e5a 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name V2EX 增强 -// @version 1.0.8 +// @version 1.0.9 // @author X.I.U // @description 自动签到、链接转图片、自动无缝翻页、回到顶部(右键点击两侧空白处)、快速回复(左键双击两侧空白处)、新标签页打开链接、标签页伪装为 Github(摸鱼) // @match *://v2ex.com/* @@ -86,7 +86,7 @@ pageElement: 'css;.cell.item', HT_insert: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1], replaceE: 'css;#Main > .box > .cell[style]:not(.item) > table', - scrollDelta: 600 + scrollDelta: 1000 }, function: { after: linksBlank, @@ -131,7 +131,7 @@ pageElement: 'css;#TopicsNode > div', HT_insert: ['css;#TopicsNode', 3], replaceE: 'css;#Main > .box > .cell[style] > table', - scrollDelta: 700 + scrollDelta: 1000 }, function: { after: linksBlank, @@ -146,7 +146,7 @@ pageElement: 'css;.cell[id^="r_"]', HT_insert: ['//div[starts-with(@id, "r_")][last()]/following-sibling::div[@class="cell"][1]', 1], replaceE: 'css;#Main > .box > .cell[style] > table', - scrollDelta: 700 + scrollDelta: 1000 } }, reply_positive: { // 帖子内容页(正序) @@ -157,7 +157,7 @@ pageElement: 'css;.cell[id^="r_"]', HT_insert: ['//div[starts-with(@id, "r_")][1]', 1], replaceE: 'css;#Main > .box > .cell[style] > table', - scrollDelta: 700 + scrollDelta: 1000 } }, balance: { // 账户余额页 @@ -177,6 +177,7 @@ switch (location.pathname) { case "/": // 首页 linksBlank('#Main a.topic-link:not([target])'); + addChangesLink(); break; case "/recent": // 最近主题页 curSite = DBSite.recent; @@ -350,6 +351,13 @@ } + // 添加全站最近更新主题链接 + function addChangesLink() { + let links = document.querySelector('#Main .box .inner:last-child');if (!links) return + links.innerHTML = `` + } + + // 自动无缝翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ From 23c6a5d65e3c4fe9b9ebee63d4c6a369f8cd454d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 5 Apr 2021 22:03:11 +0800 Subject: [PATCH 0179/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=B5=8F=E8=A7=88=E5=99=A8=E5=89=8D=E8=BF=9B/?= =?UTF-8?q?=E5=90=8E=E9=80=80=E5=90=8E=EF=BC=8CRaw=20=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=9B=BE=E6=A0=87=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 50 ++++++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index acb6d872b..298e5759e 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.4 +// @version 1.4.5 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -102,6 +102,15 @@ setTimeout(addRawDownLink, 2000); // 添加 Raw 下载链接(☁),延迟 2 秒执行,避免被 pjax 刷掉 }); + pushHistory(); + window.addEventListener('popstate', function(e) { + addRawDownLink_(); // 在浏览器返回/前进时重新添加 Raw 下载链接(☁)鼠标事件 + }, false); + function pushHistory() { + let state = {title: 'title',url: '#'}; + window.history.pushState(state, '', ''); + } + // Release function addRelease(){ @@ -214,7 +223,7 @@ // 添加 Raw 下载链接(☁) function addRawDownLink(){ - // 如果不是项目文件页面,就返回 + // 如果不是项目文件页面,就返回,如果网页有 Raw 下载链接(☁)就返回 let files = document.querySelectorAll('div.Box-row svg.octicon.octicon-file');if(files.length === 0) return; let files1 = document.querySelectorAll('a.fileDownLink');if(files1.length > 0) return; @@ -244,8 +253,7 @@ Name = cntElm_a.innerText, href = cntElm_a.attributes.href.nodeValue.replace('https://github.com',''); let href2 = href.replace('/blob/','/'), url, url_name, url_tip = ''; - switch(menu_raw_fast) - { + switch(menu_raw_fast) { case 1: url = raw_url[1][0] + '/gh' + href.replace('/blob/','@'); url_name = raw_url[1][1]; @@ -278,4 +286,38 @@ fileElm.remove() }) } + + + // 在浏览器返回/前进时重新添加 Raw 下载链接(☁)鼠标事件 + function addRawDownLink_(){ + // 如果不是项目文件页面,就返回,如果网页没有 Raw 下载链接(☁)就返回 + let files = document.querySelectorAll('div.Box-row svg.octicon.octicon-file');if(files.length === 0) return; + let files1 = document.querySelectorAll('a.fileDownLink');if(files1.length === 0) return; + + // 鼠标指向则显示 + var mouseOverHandler = function(evt){ + let elem = evt.currentTarget, + aElm_new = elem.querySelectorAll('.fileDownLink'), + aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); + aElm_new.forEach(el=>{el.style.cssText = 'display: inline'}); + aElm_now.forEach(el=>{el.style.cssText = 'display: none'}); + }; + + // 鼠标离开则隐藏 + var mouseOutHandler = function(evt){ + let elem = evt.currentTarget, + aElm_new = elem.querySelectorAll('.fileDownLink'), + aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); + aElm_new.forEach(el=>{el.style.cssText = 'display: none'}); + aElm_now.forEach(el=>{el.style.cssText = 'display: inline'}); + }; + + // 循环添加 + files.forEach(function(fileElm, i){ + let trElm = fileElm.parentNode.parentNode; + // 绑定鼠标事件 + trElm.onmouseover = mouseOverHandler; + trElm.onmouseout = mouseOutHandler; + }); + } })(); \ No newline at end of file From 2bd8b5335cf0d2bdca67caf3489f854e3e0465b9 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 9 Apr 2021 22:06:07 +0800 Subject: [PATCH 0180/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[FitGirl=20Repac?= =?UTF-8?q?ks]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index a3a2894ff..af81a3302 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.8 +// @version 1.1.9 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -12,7 +12,7 @@ // @match *://www.appinn.com/*/*/ // @match *://www.appinn.com/?s=* // @match *://www.iplaysoft.com/* -// @match *://www.pixiv.net/tags/*/* +// @match *://fitgirl-repacks.site/* // @match *://*.alphacoders.com/* // @match *://club.sanguosha.com/* // @match *://www.centbrowser.net/* @@ -160,15 +160,15 @@ scrollDelta: 1000 } }, - pixiv_tags: { + fitgirl: { SiteTypeID: 12, pager: { type: 1, - nextLink: '//nav[not(starts-with(@class,"sc-"))]//button/following-sibling::a[1][@href]', - pageElement: 'css;section > div > ul > li', - HT_insert: ['css;section > div > ul', 3], - replaceE: 'css;nav:not([class^="sc-"])', - scrollDelta: 1000 + nextLink: '//a[@class="next page-numbers"][@href]', + pageElement: 'css;article[id^="post-"]', + HT_insert: ['css;nav.navigation.paging-navigation', 1], + replaceE: 'css;nav.navigation.paging-navigation', + scrollDelta: 2000 } } }; @@ -194,8 +194,8 @@ curSite = DBSite.iplaysoft_postslist; } break; - case "www.pixiv.net": - curSite = DBSite.pixiv_tags; + case "fitgirl-repacks.site": + curSite = DBSite.fitgirl; break; case "wall.alphacoders.com": case "avatars.alphacoders.com": From 2c52ba99be9380508820f0934ea23fc1d7b96f57 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 18 Apr 2021 16:39:10 +0800 Subject: [PATCH 0181/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E5=9B=9E=E7=AD=94/=E8=AF=84?= =?UTF-8?q?=E8=AE=BA]=20=E5=8A=9F=E8=83=BD=EF=BC=9B=E4=BF=AE=E5=A4=8D=20[?= =?UTF-8?q?=E6=94=B6=E8=B5=B7=E5=BD=93=E5=89=8D=E5=9B=9E=E7=AD=94/?= =?UTF-8?q?=E8=AF=84=E8=AE=BA]=20=E5=8A=9F=E8=83=BD=E5=9C=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=B5=81=E4=B8=AD=EF=BC=88=E5=A6=82=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=EF=BC=89=E6=97=A0=E6=B3=95=E6=94=B6=E8=B5=B7=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 08d4a6616..4e9ca2ba6 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.4 +// @version 1.3.5 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -96,8 +96,8 @@ function collapsedNowAnswer(selectors) { let rightButton = document.querySelector('.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom') if (rightButton) { // 悬浮的 [收起回答](此时正在浏览回答内容 [头部区域 + 中间区域]) // 固定的 [收起评论](先看看是否展开评论) - let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if (commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { + let commentCollapseButton = rightButton.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel:first-of-type') + if (commentCollapseButton && commentCollapseButton.innerText.indexOf('收起评论') > -1) { commentCollapseButton.click(); } // 再去收起回答 @@ -110,9 +110,9 @@ function collapsedNowAnswer(selectors) { if (el.hasAttribute('data-zop-retract-question')) { if (isElementInViewport(el)) { // 固定的 [收起评论](先看看是否展开评论) - let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if (commentCollapseButton && commentCollapseButton.innerText.indexOf("收起评论") > -1) { - commentCollapseButton.click(); + let commentCollapseButton = el.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel:first-of-type') + if (commentCollapseButton && commentCollapseButton.innerText.indexOf('收起评论') > -1) { + commentCollapseButton.click(); // 如果展开了评论,就收起评论 } el.click() // 再去收起回答 break @@ -127,10 +127,10 @@ function collapsedNowAnswer(selectors) { if (commentCollapseButton) { commentCollapseButton.click(); } else { // 固定的 [收起评论](此时正在浏览评论内容 [头部区域]) - let commentCollapseButton_1 = document.querySelectorAll('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') + let commentCollapseButton_1 = document.querySelectorAll('.ContentItem-actions > button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel:first-of-type, .ContentItem-action > button.Button.Button--plain.Button--withIcon.Button--withLabel:first-of-type') if (commentCollapseButton_1.length > 0) { for (let el of commentCollapseButton_1) { - if (el.innerText.indexOf("收起评论") > -1) { + if (el.innerText.indexOf('收起评论') > -1) { if (isElementInViewport(el)) { el.click() commentCollapseButton_ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 [收起评论] 时) @@ -144,8 +144,8 @@ function collapsedNowAnswer(selectors) { if (commentCollapseButton_1.length > 0) { for (let el of commentCollapseButton_1) { if (isElementInViewport(el)) { - let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel') - if (commentCollapseButton.innerText.indexOf("收起评论") > -1) { + let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('.ContentItem-actions > button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel:first-of-type') + if (commentCollapseButton.innerText.indexOf('收起评论') > -1) { commentCollapseButton.click() break } From a4d574cfd2f15ea107d720cd756f89b69c1fd1ef Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 23 Apr 2021 20:42:44 +0800 Subject: [PATCH 0182/2377] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E9=81=97?= =?UTF-8?q?=E6=BC=8F=E7=9A=84=E5=90=8E=E5=8F=B0=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 475eec5af..c1b803472 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,12 +1,13 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.2.3 +// @version 1.2.4 // @author X.I.U // @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* // @match *://pan.lanzou.com/* +// @match *://lanzou.com/u // @match *://www.lanzou.com/account.php* // @match *://www.lanzou.com/u // @match *://up.woozooo.com/u From 0d2c3cdd8ce4296065a88d928ae34de747f8b9b0 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 23 Apr 2021 21:29:56 +0800 Subject: [PATCH 0183/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5]=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E8=8F=9C=E5=8D=95=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 59b56fbc5..aaffa09b3 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.6 +// @version 1.2.7 // @author X.I.U // @description 自动签到、自动无缝翻页、屏蔽导读悬赏贴(最新发表页) // @match *://www.52pojie.cn/* @@ -20,7 +20,8 @@ (function() { var menu_ALL = [ ['menu_autoClockIn', '自动签到', '自动签到', true], - ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], + ['menu_pageLoading', '自动无缝翻页', '自动无缝翻页', true], + ['menu_thread_pageLoading', '帖子内自动无缝翻页', '帖子内自动无缝翻页', true], ['menu_delateReward', '屏蔽导读悬赏贴(最新发表)', '屏蔽导读悬赏贴', true] ], menu_ID = []; for (let i=0;i 0) { windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 From cd49cd4ce10870dd6d6a757d705ebeae4bffb36e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 25 Apr 2021 10:56:35 +0800 Subject: [PATCH 0184/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E5=8C=BA?= =?UTF-8?q?=E5=88=AB=E9=97=AE=E9=A2=98=E6=96=87=E7=AB=A0]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E8=AF=AF=E8=AF=86=E5=88=AB=E5=B8=A6=E8=93=9D=E6=A0=87?= =?UTF-8?q?/=E9=BB=84=E6=A0=87=E7=9A=84=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=88=E4=BB=85=E6=90=9C=E7=B4=A2=E9=A1=B5?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 4e9ca2ba6..971f87311 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.5 +// @version 1.3.6 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -204,11 +204,13 @@ function addTypeTips() { if (patt_zhuanlan.test(postList[num].href)) { // 如果是文章 postList[num].innerHTML = `文章 ` + postList[num].innerHTML } else if (patt_question.test(postList[num].href)) { // 如果是问题 + if (!postList[num].getAttribute('data-tooltip')) { // 排除用户名后面的蓝标、黄标等链接 if (patt_question_answer.test(postList[num].href)) { // 如果是指向回答的问题(而非指向纯问题的链接) postList[num].innerHTML = `问题 ` + postList[num].innerHTML } else { postList[num].innerHTML = `问题 ` + postList[num].innerHTML } + } } else if (patt_video.test(postList[num].href)) { // 如果是视频 postList[num].innerHTML = `视频 ` + postList[num].innerHTML } From 434691f4e12303c1076f619346c9e4e7144537b7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 28 Apr 2021 16:40:20 +0800 Subject: [PATCH 0185/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20AlphaCoders?= =?UTF-8?q?=EF=BC=88Art=EF=BC=89=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index af81a3302..6b9072045 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.1.9 +// @version 1.2.0 // @author X.I.U // @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 // @match *://www.423down.com/* @@ -160,8 +160,22 @@ scrollDelta: 1000 } }, - fitgirl: { + art_alphacoders: { SiteTypeID: 12, + pager: { + type: 1, + nextLink: '//a[@id="next_page"][@href]', + pageElement: 'css;.container-masonry > div', + HT_insert: ['css;.container-masonry', 3], + replaceE: '//div[@class="hidden-xs hidden-sm"]/..', + scrollDelta: 1000 + }, + function: { + before: art_alphacoders_beforeFunction + } + }, + fitgirl: { + SiteTypeID: 13, pager: { type: 1, nextLink: '//a[@class="next page-numbers"][@href]', @@ -197,6 +211,10 @@ case "fitgirl-repacks.site": curSite = DBSite.fitgirl; break; + case "art.alphacoders.com": + curSite = DBSite.art_alphacoders; + setTimeout(art_alphacoders_beforeFunction_0, 1000); + break; case "wall.alphacoders.com": case "avatars.alphacoders.com": case "mobile.alphacoders.com": @@ -293,6 +311,25 @@ } + // art_alphacoders + function art_alphacoders_beforeFunction_0() { + let pageElems1 = document.querySelectorAll(".container-masonry > div") + document.querySelector(".container-masonry").style.height = "auto" + pageElems1.forEach(function (one) { + one.setAttribute("style","float: left"); + }); + } + + + // art_alphacoders 的插入前函数 + function art_alphacoders_beforeFunction(pageElems) { + pageElems.forEach(function (one) { + one.setAttribute("style","float: left"); + }); + return pageElems + } + + // 滚动条事件 function windowScroll(fn1) { var beforeScrollTop = document.documentElement.scrollTop, @@ -362,7 +399,7 @@ timeout: 5000, onload: function (response) { try { - console.log(`${response.responseText}`) + //console.log(`${response.responseText}`) var newBody = ShowPager.createDocumentByString(response.responseText); let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; From 93857fbe3d5f277b05e623e8d65643766e4628fe Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 2 May 2021 11:41:32 +0800 Subject: [PATCH 0186/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=83=85=E5=86=B5=E4=B8=8B=E8=84=9A=E6=9C=AC=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E8=BF=87=E6=97=A9=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Beautification.user.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index a95761caa..225ea8caf 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛美化 -// @version 1.0.6 +// @version 1.0.7 // @author X.I.U // @description 精简多余内容、样式优化 // @match *://www.52pojie.cn/* @@ -65,6 +65,10 @@ let style, style_1 = `.bml {display:none !important;}`, style_2 = ` +#postlist .plc .t_f img, #postlist .plc .tattl img { + max-height: 500px !important; + width: auto !important; +} a[href="connect.php?mod=config"], #toptb, #navmenu, #nv_ph, #nv, #pt .y, #chart, #ft, #custominfo_pmenu, .bm.lk, .dnch_eo_pt, .dnch_eo_pr, .dnch_eo_f, dl.pil.cl, td.plc.plm .sign, .dnch_eo_pb, .dnch_eo_pt, .pls .side-star, .pls .side-group, .res-footer-note, .comiis_nav, .scbar_hot_td, .md_ctrl, .pls.favatar .xg1 { display:none !important; } @@ -145,6 +149,11 @@ textarea#fastpostmessage { style = style_2 if (menu_value('menu_rule')) style += style_1; style_Add.innerHTML = style; - document.head.appendChild(style_Add); + let timer = setInterval(function(){ + if (document.head) { + document.head.appendChild(style_Add); + clearInterval(timer); + } + }, 10); } })(); \ No newline at end of file From 5ccf5f0476a7adb42c9e28a00803e6e9fb3c91ee Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 3 May 2021 20:19:48 +0800 Subject: [PATCH 0187/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F=EF=BC=88=E7=9F=A5?= =?UTF-8?q?=E4=B9=8E=E8=87=AA=E5=B8=A6=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 9694b030d..85e8bdede 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.2 +// @version 1.1.3 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 +// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、优化暗黑模式(知乎自带)、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -22,7 +22,8 @@ ['menu_widescreenDisplay', '宽屏显示', '一键收起回答', true], ['menu_picHeight', '调整图片最大高度', '调整图片最大高度', true], ['menu_postimg', '隐藏文章开头大图', '隐藏文章开头大图', true], - ['menu_hideTitle', '向下翻时自动隐藏顶栏', '向下翻时自动隐藏顶栏', true] + ['menu_hideTitle', '向下翻时自动隐藏顶栏', '向下翻时自动隐藏顶栏', true], + ['menu_darkMode', '优化暗黑模式(知乎自带)', '优化暗黑模式', true] ], menu_ID = []; for (let i=0;i -1){ if(window.location.href.indexOf("/edit") > -1){ From 69ac944ae9d012522874c22e16f9fc18a523059f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 3 May 2021 21:16:16 +0800 Subject: [PATCH 0188/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F=EF=BC=88=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96=E8=BF=87=EF=BC=89]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 85e8bdede..686e1a846 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.3 +// @version 1.1.4 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、优化暗黑模式(知乎自带)、文章编辑页面与实际文章宽度一致、屏蔽登录提示 +// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、开启暗黑模式(样式优化过)、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -23,7 +23,7 @@ ['menu_picHeight', '调整图片最大高度', '调整图片最大高度', true], ['menu_postimg', '隐藏文章开头大图', '隐藏文章开头大图', true], ['menu_hideTitle', '向下翻时自动隐藏顶栏', '向下翻时自动隐藏顶栏', true], - ['menu_darkMode', '优化暗黑模式(知乎自带)', '优化暗黑模式', true] + ['menu_darkMode', '开启暗黑模式(样式优化过)', '开启暗黑模式', true] ], menu_ID = []; for (let i=0;i -1){ From 859c2dbc13241a6e7904a54ea51980fd808ba942 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 09:06:43 +0800 Subject: [PATCH 0189/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 686e1a846..f553e7f78 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.4 +// @version 1.1.5 // @author X.I.U // @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、开启暗黑模式(样式优化过)、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -120,8 +120,8 @@ header.is-hidden { `, style_6 = `/* 开启暗黑模式(样式优化过) */ /* 文字颜色 */ -html[data-theme=dark] body {color: #ccc !important;} -html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title {color: #ddd !important;} +html[data-theme=dark] body {color: #bbb !important;} +html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title {color: #ccc !important;} /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} /* 背景颜色 - 问题 */ @@ -129,13 +129,16 @@ html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[da html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider {background-color: #222933 !important;} /* 背景颜色 - 用户页面 */ html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover {background: #1c2129 !important;} -/* 背景颜色 - 用户页面 - 封面大图 */ -html[data-theme=dark] .UserCover {opacity: 0.7;} +/* 背景颜色 - 用户页面 - 封面大图/文章头部大图 */ +html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.7;} /* 边框 */ html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after {border-bottom: 1px solid #1c2129 !important;} /* 背景颜色 - 专栏/文章 */ html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {background: #22272E !important;} html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} +/* 赞同按钮颜色(蓝色) */ +.TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton {color: #3faaff !important;} +/*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ ` let style_Add = document.createElement('style'); // 宽屏显示 From 75c8eab021e3e8ef7a0ac1e8465a3c6ddef47b8c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 10:12:28 +0800 Subject: [PATCH 0190/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E4=B8=A4?= =?UTF-8?q?=E7=A7=8D=20[=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 78 ++++++++++++++++++++++++++++++------ 1 file changed, 66 insertions(+), 12 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index f553e7f78..296edb49c 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.5 +// @version 1.1.6 // @author X.I.U -// @description 宽屏显示、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、开启暗黑模式(样式优化过)、文章编辑页面与实际文章宽度一致、屏蔽登录提示 +// @description 宽屏显示、暗黑模式(3种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -20,10 +20,11 @@ (function() { var menu_ALL = [ ['menu_widescreenDisplay', '宽屏显示', '一键收起回答', true], + ['menu_darkMode', '暗黑模式', '暗黑模式', true], + ['menu_darkModeType', '暗黑模式切换(1~3)', '暗黑模式切换', 1], ['menu_picHeight', '调整图片最大高度', '调整图片最大高度', true], ['menu_postimg', '隐藏文章开头大图', '隐藏文章开头大图', true], - ['menu_hideTitle', '向下翻时自动隐藏顶栏', '向下翻时自动隐藏顶栏', true], - ['menu_darkMode', '开启暗黑模式(样式优化过)', '开启暗黑模式', true] + ['menu_hideTitle', '向下翻时自动隐藏顶栏', '向下翻时自动隐藏顶栏', true] ], menu_ID = []; for (let i=0;i= 3){ + menu_status = 1; + } else { + menu_status += 1; + } + GM_setValue(`${Name}`, menu_status); + GM_notification({text: `已切换暗黑模式为:方案 ${menu_status}\n(刷新网页后生效)`, timeout: 3500}); // 提示消息 + registerMenuCommand(); // 重新注册脚本菜单 + }; + // 菜单开关 function menu_switch(menu_status, Name, Tips) { if (menu_status == 'true'){ GM_setValue(`${Name}`, false); GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); - }else{ + } else { GM_setValue(`${Name}`, true); GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); } @@ -118,7 +136,7 @@ header.is-hidden { width: auto; } `, - style_6 = `/* 开启暗黑模式(样式优化过) */ + style_6 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ html[data-theme=dark] body {color: #bbb !important;} html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title {color: #ccc !important;} @@ -139,38 +157,74 @@ html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} /* 赞同按钮颜色(蓝色) */ .TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton {color: #3faaff !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ +`, + style_7 = `/* 暗黑模式(方案 2) */ +html {filter: invert(0.8) !important;} img {filter: invert(1) !important;} +`, + style_8 = `/* 暗黑模式(方案 3) */ +html {filter: brightness(0.8) !important;} ` let style_Add = document.createElement('style'); + // 宽屏显示 if (menu_value('menu_widescreenDisplay')) { style += style_1; } + // 调整图片最大高度 if (menu_value('menu_picHeight')) { style += style_5; } + // 隐藏文章开头大图 if (menu_value('menu_postimg')) { style += style_2; } + // 向下翻时自动隐藏顶栏 if (menu_value('menu_hideTitle')) { style += style_4; } - // 开启暗黑模式(样式优化过) + + // 暗黑模式 if (menu_value('menu_darkMode')) { - style += style_6; - if (document.getElementsByTagName('html')[0].getAttribute('data-theme') != 'dark') { - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'dark') - location.search = '?theme=dark' + switch(menu_value('menu_darkModeType')) { + case 1: + style += style_6; + if (document.getElementsByTagName('html')[0].getAttribute('data-theme') != 'dark') { + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'dark') + location.search = '?theme=dark' + } + break; + case 2: + style += style_7; + if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light') + location.search = '?theme=light' + } + break; + case 3: + style += style_8; + if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light') + location.search = '?theme=light' + } + break; + } + } else { + if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light') + location.search = '?theme=light' } } + // 文章编辑页面与实际文章宽度一致 if(window.location.href.indexOf("zhuanlan") > -1){ if(window.location.href.indexOf("/edit") > -1){ style += style_3; } } + style_Add.innerHTML = style; document.head.appendChild(style_Add); } From 632e9233da004146aaddb8e3606001a19031c4b2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 10:22:12 +0800 Subject: [PATCH 0191/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index def2d22ad..92190c3bd 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、隐藏文章开头大图、调整图片最大高度、隐藏浏览... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高度... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、自动无缝翻页、回到顶部 (右键点击两侧空白处... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | From 7702cde21fc955216a2908c3ec81061e34ebea13 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 10:41:18 +0800 Subject: [PATCH 0192/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E5=88=87=E6=8D=A2=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=EF=BC=88=E5=88=87=E6=8D=A2=E5=90=8E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 296edb49c..f40d5bff8 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.6 +// @version 1.1.7 // @author X.I.U // @description 宽屏显示、暗黑模式(3种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -50,7 +50,7 @@ menu_ID[menu_ID.length] = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412212/feedback', {active: true,insert: true,setParent: true});}); } - // 切换加速源 + // 切换暗黑模式 function menu_toggle(menu_status, Name) { menu_status = parseInt(menu_status) if (menu_status >= 3){ @@ -59,8 +59,8 @@ menu_status += 1; } GM_setValue(`${Name}`, menu_status); - GM_notification({text: `已切换暗黑模式为:方案 ${menu_status}\n(刷新网页后生效)`, timeout: 3500}); // 提示消息 - registerMenuCommand(); // 重新注册脚本菜单 + //GM_notification({text: `已切换暗黑模式为:方案 ${menu_status}\n(刷新网页后生效)`, timeout: 3500}); // 提示消息 + location.reload(); // 刷新网页 }; // 菜单开关 From 3b49e111bdc49194946fd47f508922899cbf63af Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 10:55:10 +0800 Subject: [PATCH 0193/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E8=A7=86=E9=A2=91=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index f40d5bff8..c48011aa7 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.7 +// @version 1.1.8 // @author X.I.U // @description 宽屏显示、暗黑模式(3种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -159,7 +159,8 @@ html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ `, style_7 = `/* 暗黑模式(方案 2) */ -html {filter: invert(0.8) !important;} img {filter: invert(1) !important;} +html {filter: invert(0.8) !important;} +img, .ZVideoItem-video, .ZVideo-video {filter: invert(1) !important;} `, style_8 = `/* 暗黑模式(方案 3) */ html {filter: brightness(0.8) !important;} From c163883883c9a6f1ff4fac03d61a1be765f3d98b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 15:17:30 +0800 Subject: [PATCH 0194/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=96=B0=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index c48011aa7..332dc145a 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.8 +// @version 1.1.9 // @author X.I.U -// @description 宽屏显示、暗黑模式(3种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 +// @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/p/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -21,7 +21,7 @@ var menu_ALL = [ ['menu_widescreenDisplay', '宽屏显示', '一键收起回答', true], ['menu_darkMode', '暗黑模式', '暗黑模式', true], - ['menu_darkModeType', '暗黑模式切换(1~3)', '暗黑模式切换', 1], + ['menu_darkModeType', '暗黑模式切换(1~4)', '暗黑模式切换', 1], ['menu_picHeight', '调整图片最大高度', '调整图片最大高度', true], ['menu_postimg', '隐藏文章开头大图', '隐藏文章开头大图', true], ['menu_hideTitle', '向下翻时自动隐藏顶栏', '向下翻时自动隐藏顶栏', true] @@ -42,6 +42,10 @@ for (let i=0;i 4){ // 避免在减少 raw 数组后,用户储存的数据大于数组而报错 + menu_ALL[i][3] = 1; + GM_setValue('menu_darkModeType', menu_ALL[i][3]); + } menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]} ] ${menu_ALL[i][1]}`, function(){menu_toggle(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`)}); } else { menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); @@ -53,7 +57,7 @@ // 切换暗黑模式 function menu_toggle(menu_status, Name) { menu_status = parseInt(menu_status) - if (menu_status >= 3){ + if (menu_status >= 4){ menu_status = 1; } else { menu_status += 1; @@ -159,11 +163,14 @@ html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ `, style_7 = `/* 暗黑模式(方案 2) */ -html {filter: invert(0.8) !important;} +html {filter: invert(80%) !important;} img, .ZVideoItem-video, .ZVideo-video {filter: invert(1) !important;} `, style_8 = `/* 暗黑模式(方案 3) */ -html {filter: brightness(0.8) !important;} +html {filter: brightness(80%) !important;} +`, + style_9 = `/* 暗黑模式(方案 4) */ +html {filter: brightness(80%) sepia(30%) !important;} ` let style_Add = document.createElement('style'); @@ -211,6 +218,13 @@ html {filter: brightness(0.8) !important;} location.search = '?theme=light' } break; + case 4: + style += style_9; + if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light') + location.search = '?theme=light' + } + break; } } else { if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { From 2f067160eb7bbe4f9966fdc6781b9170b927333a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 15:34:20 +0800 Subject: [PATCH 0195/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 332dc145a..644db7c36 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.9 +// @version 1.1.10 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -147,20 +147,21 @@ html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader- /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs {background: #1c2129 !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs {background: #2D333B !important;} html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider {background-color: #222933 !important;} /* 背景颜色 - 用户页面 */ html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover {background: #1c2129 !important;} /* 背景颜色 - 用户页面 - 封面大图/文章头部大图 */ html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.7;} /* 边框 */ -html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after {border-bottom: 1px solid #1c2129 !important;} +html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs {border-bottom: 1px solid #282d35 !important;} /* 背景颜色 - 专栏/文章 */ html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {background: #22272E !important;} html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} -/* 赞同按钮颜色(蓝色) */ -.TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton {color: #3faaff !important;} +/* 按钮颜色(蓝色) */ +.TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag {color: #3faaff !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ +html[data-theme=dark] .Reward-rewardBtn {color: #ffffff !important;} `, style_7 = `/* 暗黑模式(方案 2) */ html {filter: invert(80%) !important;} From 8b8dede3ce781bfd84c2517a2cbd2135d1786323 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 16:11:36 +0800 Subject: [PATCH 0196/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 644db7c36..8980c646d 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.10 +// @version 1.1.11 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -142,8 +142,8 @@ header.is-hidden { `, style_6 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ -html[data-theme=dark] body {color: #bbb !important;} -html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title {color: #ccc !important;} +html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title {color: #d1d5d9 !important;} + /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} /* 背景颜色 - 问题 */ @@ -151,13 +151,19 @@ html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[da html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider {background-color: #222933 !important;} /* 背景颜色 - 用户页面 */ html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover {background: #1c2129 !important;} -/* 背景颜色 - 用户页面 - 封面大图/文章头部大图 */ -html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.7;} + +/* 封面大图/文章头部大图 */ +html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.8 !important;} +/* 其他图片 */ +html[data-theme=dark] img {opacity: 0.9 !important;} + /* 边框 */ html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs {border-bottom: 1px solid #282d35 !important;} + /* 背景颜色 - 专栏/文章 */ html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {background: #22272E !important;} html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} + /* 按钮颜色(蓝色) */ .TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag {color: #3faaff !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ From 8941e76f3312e7380dacd675c7fc2fe49e4a1d87 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 4 May 2021 20:38:33 +0800 Subject: [PATCH 0197/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 8980c646d..f670cdf12 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -142,7 +142,7 @@ header.is-hidden { `, style_6 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ -html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title {color: #d1d5d9 !important;} +html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title {color: #adbac7 !important;} /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} @@ -152,8 +152,11 @@ html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .Comm /* 背景颜色 - 用户页面 */ html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover {background: #1c2129 !important;} +/* 背景颜色 - 引用 */ +html[data-theme=dark] .ztext blockquote {color: #768390 !important;border-left: 3px solid #3b3b3b !important;} + /* 封面大图/文章头部大图 */ -html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.8 !important;} +html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.7 !important;} /* 其他图片 */ html[data-theme=dark] img {opacity: 0.9 !important;} @@ -174,10 +177,10 @@ html {filter: invert(80%) !important;} img, .ZVideoItem-video, .ZVideo-video {filter: invert(1) !important;} `, style_8 = `/* 暗黑模式(方案 3) */ -html {filter: brightness(80%) !important;} +html {filter: brightness(75%) !important;} `, style_9 = `/* 暗黑模式(方案 4) */ -html {filter: brightness(80%) sepia(30%) !important;} +html {filter: brightness(75%) sepia(30%) !important;} ` let style_Add = document.createElement('style'); From a966e048a5edb14164cc1cf46f140c30aaea48e5 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 6 May 2021 12:17:44 +0800 Subject: [PATCH 0198/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E9=80=BB=E8=BE=91=E4=BB=A3?= =?UTF-8?q?=E7=A0=81;=20=E4=BC=98=E5=8C=96=20[=E6=9A=97=E9=BB=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F]=20=E6=96=B9=E6=A1=88=E4=B8=80=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=EF=BC=88=E7=A7=81=E4=BF=A1=E3=80=81=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E3=80=81=E8=BE=B9=E6=A1=86=E7=AD=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 92 ++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 31 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index f670cdf12..0c3b3d2b5 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.11 +// @version 1.1.12 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -19,7 +19,7 @@ (function() { var menu_ALL = [ - ['menu_widescreenDisplay', '宽屏显示', '一键收起回答', true], + ['menu_widescreenDisplay', '宽屏显示', '宽屏显示', true], ['menu_darkMode', '暗黑模式', '暗黑模式', true], ['menu_darkModeType', '暗黑模式切换(1~4)', '暗黑模式切换', 1], ['menu_picHeight', '调整图片最大高度', '调整图片最大高度', true], @@ -63,18 +63,43 @@ menu_status += 1; } GM_setValue(`${Name}`, menu_status); - //GM_notification({text: `已切换暗黑模式为:方案 ${menu_status}\n(刷新网页后生效)`, timeout: 3500}); // 提示消息 - location.reload(); // 刷新网页 + if (menu_status === 1) { // 设置 Cookie + if (getTheme() === 'light') document.cookie="theme=dark; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + } else { + if (getTheme() === 'dark') document.cookie="theme=light; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + } + if (menu_value('menu_darkMode')) { + location.reload(); // 刷新网页 + } else { + GM_notification({text: `已切换暗黑模式为:方案 ${menu_status}\n`, timeout: 3500}); // 提示消息 + registerMenuCommand(); // 重新注册脚本菜单 + } }; // 菜单开关 function menu_switch(menu_status, Name, Tips) { if (menu_status == 'true'){ GM_setValue(`${Name}`, false); - GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + + if (Name === 'menu_darkMode') { // 暗黑模式 + if (getTheme() === 'dark') document.cookie="theme=light; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + location.reload(); // 刷新网页 + } else { + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + } } else { GM_setValue(`${Name}`, true); - GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + + if (Name === 'menu_darkMode') { + if (menu_value('menu_darkModeType') === 1) { + if (getTheme() === 'light') document.cookie="theme=dark; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + } else { + if (getTheme() === 'dark') document.cookie="theme=light; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + } + location.reload(); // 刷新网页 + } else { + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + } } registerMenuCommand(); // 重新注册脚本菜单 }; @@ -147,21 +172,37 @@ html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data- /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs {background: #2D333B !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover {background: #2D333B !important;} html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider {background-color: #222933 !important;} -/* 背景颜色 - 用户页面 */ -html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover {background: #1c2129 !important;} /* 背景颜色 - 引用 */ html[data-theme=dark] .ztext blockquote {color: #768390 !important;border-left: 3px solid #3b3b3b !important;} +/* 私信 */ +html[data-theme=dark] .Input-wrapper {background-color: #30363f !important;} +html[data-theme="dark"] .TextMessage-sender, html[data-theme="dark"] .TextMessage-sender::after {background-color: #57616f !important;} +html[data-theme="dark"] .TextMessage-receiver, html[data-theme="dark"] .TextMessage-receiver::after {background-color: #1e5fbf !important;} + +html[data-theme="dark"] .TextMessage-sender, html[data-theme=dark] .TextMessage-receiver {color: #dcdcdc !important;} +/*html[data-theme="dark"] .MessagesBox::-webkit-scrollbar {width: 0px !important;height: 0px !important;}*/ +html[data-theme=dark] .ToolBar, html[data-theme=dark] .Input-wrapper {border: none !important;} +html[data-theme=dark] .Messages-item:hover {background-color: #272c33 !important;} + /* 封面大图/文章头部大图 */ html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.7 !important;} /* 其他图片 */ html[data-theme=dark] img {opacity: 0.9 !important;} /* 边框 */ -html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs {border-bottom: 1px solid #282d35 !important;} +html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs, html[data-theme=dark] .Popover-arrow:after {border-bottom: 1px solid #282d35 !important;} +html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .CommentEditorV2-inputWrap {border: none !important;} +html[data-theme=dark] .InputLike {border: 1px solid #424b56 !important;} + +/* 滚动条 */ +html[data-theme=dark] body::-webkit-scrollbar, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar, html[data-theme="dark"] .Messages-list::-webkit-scrollbar, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar, html[data-theme=dark] .CommentListV2::-webkit-scrollbar {width: 6px !important;height: 1px !important;} +html[data-theme=dark] body::-webkit-scrollbar-thumb, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar-thumb, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-thumb, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-thumb, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-thumb {background: #3f4752 !important;} +html[data-theme=dark] body::-webkit-scrollbar-track {background: #22272e !important;} +html[data-theme="dark"] .MessagesBox::-webkit-scrollbar-track, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-track, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-track, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-track {background: #2d333b !important;} /* 背景颜色 - 专栏/文章 */ html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {background: #22272E !important;} @@ -209,38 +250,17 @@ html {filter: brightness(75%) sepia(30%) !important;} switch(menu_value('menu_darkModeType')) { case 1: style += style_6; - if (document.getElementsByTagName('html')[0].getAttribute('data-theme') != 'dark') { - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'dark') - location.search = '?theme=dark' - } break; case 2: style += style_7; - if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light') - location.search = '?theme=light' - } break; case 3: style += style_8; - if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light') - location.search = '?theme=light' - } break; case 4: style += style_9; - if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light') - location.search = '?theme=light' - } break; } - } else { - if (document.getElementsByTagName('html')[0].getAttribute('data-theme') === 'dark') { - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light') - location.search = '?theme=light' - } } // 文章编辑页面与实际文章宽度一致 @@ -253,4 +273,14 @@ html {filter: brightness(75%) sepia(30%) !important;} style_Add.innerHTML = style; document.head.appendChild(style_Add); } + function getTheme() { + var name = "theme="; + var ca = document.cookie.split(';'); + for(var i=0; i Date: Thu, 6 May 2021 22:58:07 +0800 Subject: [PATCH 0199/2377] =?UTF-8?q?=E8=B0=83=E6=95=B4=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E4=B8=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 0c3b3d2b5..1ec650629 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.12 +// @version 1.1.13 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -20,7 +20,7 @@ (function() { var menu_ALL = [ ['menu_widescreenDisplay', '宽屏显示', '宽屏显示', true], - ['menu_darkMode', '暗黑模式', '暗黑模式', true], + ['menu_darkMode', '暗黑模式', '暗黑模式', false], ['menu_darkModeType', '暗黑模式切换(1~4)', '暗黑模式切换', 1], ['menu_picHeight', '调整图片最大高度', '调整图片最大高度', true], ['menu_postimg', '隐藏文章开头大图', '隐藏文章开头大图', true], From fe07e1207c596286aac3e59de0cfb004cdd26dd7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 7 May 2021 08:46:01 +0800 Subject: [PATCH 0200/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E4=BB=A3=E7=A0=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 1ec650629..4b0fb0fbd 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.13 +// @version 1.1.14 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -20,7 +20,7 @@ (function() { var menu_ALL = [ ['menu_widescreenDisplay', '宽屏显示', '宽屏显示', true], - ['menu_darkMode', '暗黑模式', '暗黑模式', false], + ['menu_darkMode', '暗黑模式', '暗黑模式', true], ['menu_darkModeType', '暗黑模式切换(1~4)', '暗黑模式切换', 1], ['menu_picHeight', '调整图片最大高度', '调整图片最大高度', true], ['menu_postimg', '隐藏文章开头大图', '隐藏文章开头大图', true], @@ -250,6 +250,11 @@ html {filter: brightness(75%) sepia(30%) !important;} switch(menu_value('menu_darkModeType')) { case 1: style += style_6; + if (getTheme() === 'light') { + document.cookie="theme=dark; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'dark') + location.reload(); // 刷新网页 + } break; case 2: style += style_7; From 69588e1ee9178523d13cb28a2e6bbda5c5ccb28f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 7 May 2021 20:41:08 +0800 Subject: [PATCH 0201/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7=E3=80=81=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E7=9B=90=E9=80=89=E5=86=85=E5=AE=B9]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 126 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 123 insertions(+), 3 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 971f87311..5c1c6e3a3 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.6 +// @version 1.3.7 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 +// @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -21,11 +21,13 @@ var menu_ALL = [ ['menu_collapsedAnswer', '一键收起回答', '一键收起回答', true], ['menu_collapsedNowAnswer', '收起当前回答/评论(点击两侧空白处)', '收起当前回答/评论', true], ['menu_backToTop', '快捷回到顶部(右键两侧空白处)', '快捷回到顶部', true], + ['menu_blockUsers', '屏蔽指定用户(测试)', '屏蔽指定用户', false], + ['menu_blockYanXuan', '屏蔽盐选内容', '屏蔽盐选内容', false], ['menu_publishTop', '置顶显示时间', '置顶显示时间', true], ['menu_allTime', '完整显示时间', '完整显示时间', true], ['menu_typeTips', '区分问题文章', '区分问题文章', true], ['menu_directLink', '默认站外直链', '默认站外直链', true] -], menu_ID = []; +], menu_ID = [], blockUsersList = ['故事档案局', '盐选推荐', '盐选科普', '盐选成长计划', '知乎盐选会员', '知乎盐选创作者', '盐选心理', '盐选健康必修课', '盐选奇妙物语', '盐选生活馆', '盐选职场', '盐选文学甄选', '盐选作者小管家', '盐选博物馆', '盐选点金', '盐选测评室', '盐选科技前沿', '盐选会员精品']; for (let i=0;i { + if (e.target.innerHTML && e.target.getElementsByClassName('Feed').length > 0) { + let item = e.target.getElementsByClassName('Feed')[0].getElementsByClassName('ContentItem AnswerItem')[0]; // 用户名所在元素 + if (item) { + blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + if (item.dataset.zop.indexOf('authorName":"' + item1 + '",') > -1) { // 找到就删除该信息流 + console.log(item.dataset.zop); + item.parentNode.parentNode.remove(); + } + }) + } + } + } + document.addEventListener('DOMNodeInserted', blockUsers); // 监听插入事件 + + let listItem = document.getElementsByClassName('Card TopstoryItem TopstoryItem--old TopstoryItem-isRecommend'); + Array.from(listItem).forEach(function(item){ // 遍历所有回答 + let listName = item.querySelector('.ContentItem.AnswerItem') // 用户名所在元素 + if (listName) { + blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + if (listName.dataset.zop.indexOf('authorName":"' + item1 + '",') > -1) { // 找到就删除该信息流 + console.log(listName.dataset.zop); + item.remove(); + } + }) + } + }) + } + + function blockUsers_question() { + let blockUsers = e => { + if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem AnswerItem').length > 0) { + let item = e.target.getElementsByClassName('ContentItem AnswerItem')[0]; // 用户名所在元素 + if (item) { + blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + if (item.dataset.zop.indexOf('authorName":"' + item1 + '",') > -1) { // 找到就删除该回答 + console.log(item.dataset.zop) + item.parentNode.remove(); + } + }) + } + } + } + document.addEventListener('DOMNodeInserted', blockUsers); // 监听插入事件 + + let listItem = document.getElementsByClassName('ContentItem AnswerItem'); + Array.from(listItem).forEach(function(item){ // 遍历所有回答 // 用户名所在元素 + if (item) { + blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + if (item.dataset.zop.indexOf('authorName":"' + item1 + '",') > -1) { // 找到就删除该回答 + console.log(item.dataset.zop) + item.parentNode.remove(); + } + }) + } + }) + } + + function blockUsers_search() { + let blockUsers = e => { + if (e.target.innerHTML && e.target.getElementsByClassName('List-item').length > 0) { + let item = e.target.getElementsByClassName('List-item')[0]; + let listName = item.querySelector('.RichText.ztext.CopyrightRichText-richText b') // 用户名所在元素 + if (listName) { + blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + if (item1 === listName.innerText) { // 找到就删除该搜索结果 + console.log(listName.innerText); + item.parentNode.remove(); + } + }) + } + } + } + document.addEventListener('DOMNodeInserted', blockUsers); // 监听插入事件 + } +} + + +// 屏蔽盐选内容 +function blockYanXuan() { + if (!menu_value('menu_blockYanXuan')) return + let blockYanXuan = e => { + if (e.target.innerHTML && e.target.getElementsByClassName('KfeCollection-PurchaseBtn-mask').length > 0) { + let item = e.target.getElementsByClassName('KfeCollection-PurchaseBtn-mask')[0]; + item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } + } + document.addEventListener('DOMNodeInserted', blockYanXuan); // 监听插入事件 + + let listItem = document.getElementsByClassName('List-item'); + Array.from(listItem).forEach(function(item){ + if (item.getElementsByClassName('KfeCollection-PurchaseBtn-mask').length > 0) { + item.remove(); + } + }) +} + + var postNum; // 区分问题文章 function addTypeTips() { @@ -520,6 +636,8 @@ function questionInvitation(){ collapsedAnswer(); // 一键收起回答 collapsedNowAnswer(".QuestionPage"); // 收起当前回答 + 快捷返回顶部 collapsedNowAnswer(".Question-main"); // 收起当前回答 + 快捷返回顶部 + blockUsers('question'); + blockYanXuan(); } setInterval(topTime_question, 300); // 置顶显示时间 } else if (window.location.href.indexOf("search") > -1) { // 搜索结果页 // @@ -528,6 +646,7 @@ function questionInvitation(){ collapsedNowAnswer(".Search-container"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_search, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 + blockUsers('search'); } else if (window.location.href.indexOf("topic") > -1) { // 话题页 // if (window.location.href.indexOf("hot") > -1 || window.location.href.indexOf("top-answers") > -1) { // 仅限 [讨论] [精华] collapsedAnswer(); // 一键收起回答 @@ -555,5 +674,6 @@ function questionInvitation(){ collapsedNowAnswer(".Topstory-container"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_index, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 + blockUsers('index'); } })(); \ No newline at end of file From d418f4610b962a1dc69e3bbcbd91fa82e648e9c2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 7 May 2021 20:58:11 +0800 Subject: [PATCH 0202/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7=E3=80=81=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E7=9B=90=E9=80=89=E5=86=85=E5=AE=B9]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 74 +++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 5c1c6e3a3..0371f9dab 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -626,54 +626,54 @@ function questionInvitation(){ (function() { - addEventListener_DOMNodeInserted(); // 监听 网页插入元素 事件 - questionInvitation(); // 默认折叠邀请 - setInterval(originalPic,100); // 默认高清原图 - if (menu_value('menu_directLink')) setInterval(directLink, 100); // 默认站外直链 + addEventListener_DOMNodeInserted(); // 监听 网页插入元素 事件 + questionInvitation(); // 默认折叠邀请 + setInterval(originalPic,100); // 默认高清原图 + if (menu_value('menu_directLink')) setInterval(directLink, 100); // 默认站外直链 if (window.location.href.indexOf("question") > -1) { // 回答页 // if (window.location.href.indexOf("waiting") == -1) { - collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer(".QuestionPage"); // 收起当前回答 + 快捷返回顶部 - collapsedNowAnswer(".Question-main"); // 收起当前回答 + 快捷返回顶部 - blockUsers('question'); - blockYanXuan(); + collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer(".QuestionPage"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".Question-main"); // 收起当前回答 + 快捷返回顶部 + blockUsers('question'); // 屏蔽指定用户 + blockYanXuan(); // 屏蔽盐选内容 } - setInterval(topTime_question, 300); // 置顶显示时间 + setInterval(topTime_question, 300); // 置顶显示时间 } else if (window.location.href.indexOf("search") > -1) { // 搜索结果页 // - collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 - collapsedNowAnswer(".Search-container"); // 收起当前回答 + 快捷返回顶部 - setInterval(topTime_search, 300); // 置顶显示时间 - EventXMLHttpRequest(); // 区分问题文章 - blockUsers('search'); + collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".Search-container"); // 收起当前回答 + 快捷返回顶部 + setInterval(topTime_search, 300); // 置顶显示时间 + EventXMLHttpRequest(); // 区分问题文章 + blockUsers('search'); // 屏蔽指定用户 } else if (window.location.href.indexOf("topic") > -1) { // 话题页 // if (window.location.href.indexOf("hot") > -1 || window.location.href.indexOf("top-answers") > -1) { // 仅限 [讨论] [精华] - collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main.App-main"); // 收起当前回答 + 快捷返回顶部 - collapsedNowAnswer(".ContentLayout"); // 收起当前回答 + 快捷返回顶部 - setInterval(topTime_people, 300); // 置顶显示时间 - EventXMLHttpRequest(); // 区分问题文章 + collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main.App-main"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".ContentLayout"); // 收起当前回答 + 快捷返回顶部 + setInterval(topTime_people, 300); // 置顶显示时间 + EventXMLHttpRequest(); // 区分问题文章 } } else if (window.location.href.indexOf("zhuanlan") > -1){ // 文章 // - backToTop("article.Post-Main.Post-NormalMain"); // 快捷返回顶部 - backToTop("div.Post-Sub.Post-NormalSub"); // 快捷返回顶部 - setInterval(topTime_zhuanlan, 300); // 置顶显示时间 + backToTop("article.Post-Main.Post-NormalMain"); // 快捷返回顶部 + backToTop("div.Post-Sub.Post-NormalSub"); // 快捷返回顶部 + setInterval(topTime_zhuanlan, 300); // 置顶显示时间 } else if (window.location.href.indexOf("column") > -1) { // 专栏 // - collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 - setInterval(topTime_zhuanlan, 300); // 置顶显示时间 + collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 + setInterval(topTime_zhuanlan, 300); // 置顶显示时间 } else if (window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1) { // 用户主页 // - collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 - collapsedNowAnswer(".Profile-main"); // 收起当前回答 + 快捷返回顶部 - setInterval(topTime_people, 300); // 置顶显示时间 + collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".Profile-main"); // 收起当前回答 + 快捷返回顶部 + setInterval(topTime_people, 300); // 置顶显示时间 } else { // 首页 // - collapsedAnswer(); // 一键收起回答 - collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 - collapsedNowAnswer(".Topstory-container"); // 收起当前回答 + 快捷返回顶部 - setInterval(topTime_index, 300); // 置顶显示时间 - EventXMLHttpRequest(); // 区分问题文章 - blockUsers('index'); + collapsedAnswer(); // 一键收起回答 + collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 + collapsedNowAnswer(".Topstory-container"); // 收起当前回答 + 快捷返回顶部 + setInterval(topTime_index, 300); // 置顶显示时间 + EventXMLHttpRequest(); // 区分问题文章 + blockUsers('index'); // 屏蔽指定用户 } })(); \ No newline at end of file From 863bda5621573370eb2fa11399b2309c40172411 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 7 May 2021 21:04:25 +0800 Subject: [PATCH 0203/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92190c3bd..89a587021 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高度... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、置顶显示时间、区分问题文章... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内容... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、自动无缝翻页、回到顶部 (右键点击两侧空白处... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 423Down、Apphot、不死鸟、小众软件、异次元软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | From af22880046d3a363dc0cdff4a71e984dabd7ad24 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 7 May 2021 21:05:21 +0800 Subject: [PATCH 0204/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F=EF=BC=881?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 4b0fb0fbd..c6eae9ff6 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.14 +// @version 1.1.15 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -167,13 +167,13 @@ header.is-hidden { `, style_6 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ -html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title {color: #adbac7 !important;} +html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container {color: #adbac7 !important;} /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover {background: #2D333B !important;} -html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider {background-color: #222933 !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root {background: #2D333B !important;} +html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller {background-color: #222933 !important;} /* 背景颜色 - 引用 */ html[data-theme=dark] .ztext blockquote {color: #768390 !important;border-left: 3px solid #3b3b3b !important;} From 0922bdec8e055ed893feec7fe6813a8a78abdbd2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 8 May 2021 00:23:49 +0800 Subject: [PATCH 0205/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7]=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89=E5=B1=8F=E8=94=BD=E7=94=A8?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 0371f9dab..2739f6b25 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.7 +// @version 1.3.8 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -21,13 +21,14 @@ var menu_ALL = [ ['menu_collapsedAnswer', '一键收起回答', '一键收起回答', true], ['menu_collapsedNowAnswer', '收起当前回答/评论(点击两侧空白处)', '收起当前回答/评论', true], ['menu_backToTop', '快捷回到顶部(右键两侧空白处)', '快捷回到顶部', true], - ['menu_blockUsers', '屏蔽指定用户(测试)', '屏蔽指定用户', false], + ['menu_blockUsers', '屏蔽指定用户', '屏蔽指定用户', false], + ['menu_customBlockUsers', '自定义屏蔽用户', '自定义屏蔽用户', ['故事档案局', '盐选推荐', '盐选科普', '盐选成长计划', '知乎盐选会员', '知乎盐选创作者', '盐选心理', '盐选健康必修课', '盐选奇妙物语', '盐选生活馆', '盐选职场', '盐选文学甄选', '盐选作者小管家', '盐选博物馆', '盐选点金', '盐选测评室', '盐选科技前沿', '盐选会员精品']], ['menu_blockYanXuan', '屏蔽盐选内容', '屏蔽盐选内容', false], ['menu_publishTop', '置顶显示时间', '置顶显示时间', true], ['menu_allTime', '完整显示时间', '完整显示时间', true], ['menu_typeTips', '区分问题文章', '区分问题文章', true], ['menu_directLink', '默认站外直链', '默认站外直链', true] -], menu_ID = [], blockUsersList = ['故事档案局', '盐选推荐', '盐选科普', '盐选成长计划', '知乎盐选会员', '知乎盐选创作者', '盐选心理', '盐选健康必修课', '盐选奇妙物语', '盐选生活馆', '盐选职场', '盐选文学甄选', '盐选作者小管家', '盐选博物馆', '盐选点金', '盐选测评室', '盐选科技前沿', '盐选会员精品']; +], menu_ID = []; for (let i=0;i 0) { let item = e.target.getElementsByClassName('Feed')[0].getElementsByClassName('ContentItem AnswerItem')[0]; // 用户名所在元素 if (item) { - blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 if (item.dataset.zop.indexOf('authorName":"' + item1 + '",') > -1) { // 找到就删除该信息流 console.log(item.dataset.zop); item.parentNode.parentNode.remove(); @@ -222,7 +239,7 @@ function blockUsers(type) { Array.from(listItem).forEach(function(item){ // 遍历所有回答 let listName = item.querySelector('.ContentItem.AnswerItem') // 用户名所在元素 if (listName) { - blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 if (listName.dataset.zop.indexOf('authorName":"' + item1 + '",') > -1) { // 找到就删除该信息流 console.log(listName.dataset.zop); item.remove(); @@ -237,7 +254,7 @@ function blockUsers(type) { if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem AnswerItem').length > 0) { let item = e.target.getElementsByClassName('ContentItem AnswerItem')[0]; // 用户名所在元素 if (item) { - blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 if (item.dataset.zop.indexOf('authorName":"' + item1 + '",') > -1) { // 找到就删除该回答 console.log(item.dataset.zop) item.parentNode.remove(); @@ -251,7 +268,7 @@ function blockUsers(type) { let listItem = document.getElementsByClassName('ContentItem AnswerItem'); Array.from(listItem).forEach(function(item){ // 遍历所有回答 // 用户名所在元素 if (item) { - blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 if (item.dataset.zop.indexOf('authorName":"' + item1 + '",') > -1) { // 找到就删除该回答 console.log(item.dataset.zop) item.parentNode.remove(); From 58427d28417d442a7def60670a09aa25b240aec6 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 8 May 2021 10:42:18 +0800 Subject: [PATCH 0206/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=AE=BD?= =?UTF-8?q?=E5=B1=8F=E6=98=BE=E7=A4=BA]=20=E6=94=AF=E6=8C=81=E5=9C=88?= =?UTF-8?q?=E5=AD=90;=20=E4=BC=98=E5=8C=96=20[=E6=9A=97=E9=BB=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F=E4=B8=80=EF=BC=88=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E3=80=81=E7=A7=81=E4=BF=A1=E3=80=81=E5=9C=88=E5=AD=90?= =?UTF-8?q?=E3=80=81=E7=83=AD=E6=A6=9C=E3=80=81=E5=8A=A0=E8=BD=BD=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E7=AD=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 50 +++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index c6eae9ff6..df1e2e43b 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.15 +// @version 1.1.16 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -126,10 +126,10 @@ .Recommendations-Main {display: none !important;} `, style_1 = `/* 宽屏显示 */ -.GlobalSideBar,.Question-sideColumn,.ContentLayout-sideColumn,.SearchSideBar,.Card.QuestionHeaderTopicMeta { +.GlobalSideBar, .Question-sideColumn, .ContentLayout-sideColumn, .SearchSideBar, .Card.QuestionHeaderTopicMeta, .ClubSideBar { display: none !important; } -.Topstory-mainColumn,.Question-mainColumn,.ContentLayout-mainColumn,.SearchMain,.QuestionWaiting-mainColumn { +.Topstory-mainColumn, .Question-mainColumn, .ContentLayout-mainColumn,.SearchMain, .QuestionWaiting-mainColumn, .Club-mainColumn, .Post-mainColumn { width: 1000px !important; } .QuestionWaiting-mainColumn { @@ -167,26 +167,40 @@ header.is-hidden { `, style_6 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ -html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container {color: #adbac7 !important;} +html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content {color: #adbac7 !important;} +/* 热榜标题 */ +html[data-theme=dark] .HotItem-title {color: #c4cfda !important;} /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root {background: #2D333B !important;} -html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller {background-color: #222933 !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap {background: #2D333B !important;} +html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item {background-color: #222933 !important;} +html[data-theme=dark] .CornerButton:hover {background: #3f4752 !important;} /* 右下角按钮 */ /* 背景颜色 - 引用 */ html[data-theme=dark] .ztext blockquote {color: #768390 !important;border-left: 3px solid #3b3b3b !important;} +/* 加载动画 */ +html[data-theme=dark] .PlaceHolder-bg {background: -webkit-gradient(linear,left top,right top,from(#22272e),color-stop(20%,#2d333b),color-stop(40%,#22272e),to(#22272e)) !important;background: linear-gradient(90deg,#22272e 0,#2d333b 20%,#22272e 40%,#22272e) !important;} +html[data-theme=dark] .PlaceHolder-inner {background: #22272e !important;color: #2d333b !important;} + /* 私信 */ html[data-theme=dark] .Input-wrapper {background-color: #30363f !important;} -html[data-theme="dark"] .TextMessage-sender, html[data-theme="dark"] .TextMessage-sender::after {background-color: #57616f !important;} -html[data-theme="dark"] .TextMessage-receiver, html[data-theme="dark"] .TextMessage-receiver::after {background-color: #1e5fbf !important;} +html[data-theme=dark] .TextMessage-sender, html[data-theme="dark"] .TextMessage-sender::after {background-color: #57616f !important;} +html[data-theme=dark] .TextMessage-receiver, html[data-theme="dark"] .TextMessage-receiver::after {background-color: #1e5fbf !important;} + +html[data-theme=dark] .TextMessage-sender, html[data-theme=dark] .TextMessage-receiver {color: #dcdcdc !important;} +/*html[data-theme=dark] .MessagesBox::-webkit-scrollbar {width: 0px !important;height: 0px !important;}*/ +html[data-theme=dark] .ToolBar, html[data-theme=dark] .Input-wrapper, html[data-theme=dark] .ClubTopPosts {border: none !important;} + +/* 私信网页 */ +html[data-theme=dark] .ChatUserListItem .Chat-ActionMenuPopover-Button {background: -webkit-gradient(linear,left top,right top,from(rgba(18,18,18,0)),color-stop(20%,#22272e)) !important;background: linear-gradient(90deg,rgba(18,18,18,0),#22272e 20%) !important;} -html[data-theme="dark"] .TextMessage-sender, html[data-theme=dark] .TextMessage-receiver {color: #dcdcdc !important;} -/*html[data-theme="dark"] .MessagesBox::-webkit-scrollbar {width: 0px !important;height: 0px !important;}*/ -html[data-theme=dark] .ToolBar, html[data-theme=dark] .Input-wrapper {border: none !important;} -html[data-theme=dark] .Messages-item:hover {background-color: #272c33 !important;} +/* 选项鼠标指向时背景颜色 */ +html[data-theme=dark] .Messages-item:hover, html[data-theme=dark] .GlobalSideBar-navLink:hover, html[data-theme=dark] .Menu-item.is-active, html[data-theme=dark] .ActionMenu-item:hover, html[data-theme=dark] .ChatUserListItem--active {background-color: #272c33 !important;} +/* 通知 */ +html[data-theme=dark] .PushNotifications-item a {color: #8ab5e0 !important;} /* 封面大图/文章头部大图 */ html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.7 !important;} @@ -195,21 +209,21 @@ html[data-theme=dark] img {opacity: 0.9 !important;} /* 边框 */ html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs, html[data-theme=dark] .Popover-arrow:after {border-bottom: 1px solid #282d35 !important;} -html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .CommentEditorV2-inputWrap {border: none !important;} +html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .PostItem {border: none !important;} html[data-theme=dark] .InputLike {border: 1px solid #424b56 !important;} /* 滚动条 */ -html[data-theme=dark] body::-webkit-scrollbar, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar, html[data-theme="dark"] .Messages-list::-webkit-scrollbar, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar, html[data-theme=dark] .CommentListV2::-webkit-scrollbar {width: 6px !important;height: 1px !important;} -html[data-theme=dark] body::-webkit-scrollbar-thumb, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar-thumb, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-thumb, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-thumb, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-thumb {background: #3f4752 !important;} -html[data-theme=dark] body::-webkit-scrollbar-track {background: #22272e !important;} -html[data-theme="dark"] .MessagesBox::-webkit-scrollbar-track, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-track, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-track, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-track {background: #2d333b !important;} +html[data-theme=dark] body::-webkit-scrollbar, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar, html[data-theme="dark"] .Messages-list::-webkit-scrollbar, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar, html[data-theme=dark] .CommentListV2::-webkit-scrollbar, .ChatListGroup-SectionContent::-webkit-scrollbar, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar {width: 6px !important;height: 1px !important;} +html[data-theme=dark] body::-webkit-scrollbar-thumb, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar-thumb, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-thumb, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-thumb, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-thumb, .ChatListGroup-SectionContent::-webkit-scrollbar-thumb, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-thumb {background: #3f4752 !important;} +html[data-theme=dark] body::-webkit-scrollbar-track, .ChatListGroup-SectionContent::-webkit-scrollbar-track, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-track {background: #22272e !important;} +html[data-theme=dark] .MessagesBox::-webkit-scrollbar-track, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-track, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-track, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-track {background: #2d333b !important;} /* 背景颜色 - 专栏/文章 */ html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {background: #22272E !important;} html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} /* 按钮颜色(蓝色) */ -.TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag {color: #3faaff !important;} +.TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag, html[data-theme=dark] .HotListNav-item.is-active {color: #3faaff !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ html[data-theme=dark] .Reward-rewardBtn {color: #ffffff !important;} `, From 6e765480873f7da82896377814ecd9f8ab63b0fa Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 8 May 2021 13:01:26 +0800 Subject: [PATCH 0207/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 2739f6b25..911c91fc5 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.8 +// @version 1.3.9 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -356,13 +356,11 @@ function addTypeTips() { // 监听 网页插入元素 事件 function addEventListener_DOMNodeInserted() { - // 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126 + // 知乎免登录,修改自:https://greasyfork.org/zh-CN/scripts/417126 let removeLoginModal = e => { if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper').length > 0) { - if (e.target.getElementsByClassName('Modal-wrapper')[0].querySelector('.signFlowModal')){ - e.target.getElementsByClassName('Modal-wrapper')[0].remove(); - } - setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); + let button = e.target.getElementsByClassName('Modal-wrapper')[0].getElementsByClassName('Button Modal-closeButton Button--plain')[0]; + if (button)button.click(); } } @@ -382,8 +380,8 @@ function addEventListener_DOMNodeInserted() { if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 document.addEventListener('DOMNodeInserted', removeLoginModal); - document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录]按钮跳转至登录页面 - document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎]按钮跳转至注册页面(实际上是同一个页面) + document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录] 按钮跳转至登录页面 + document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎] 按钮跳转至注册页面(实际上是同一个页面) } else if(window.location.href.indexOf("zhuanlan") > -1){ document.addEventListener('DOMNodeInserted', removeLoginModal); } From b93e6561a677d29e29c90e9cd74585aadc1b0a1f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 8 May 2021 13:07:16 +0800 Subject: [PATCH 0208/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 911c91fc5..81e0d2d3d 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -359,7 +359,7 @@ function addEventListener_DOMNodeInserted() { // 知乎免登录,修改自:https://greasyfork.org/zh-CN/scripts/417126 let removeLoginModal = e => { if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper').length > 0) { - let button = e.target.getElementsByClassName('Modal-wrapper')[0].getElementsByClassName('Button Modal-closeButton Button--plain')[0]; + let button = e.target.getElementsByClassName('Button Modal-closeButton Button--plain')[0]; if (button)button.click(); } } From 68c5c8619f2abbbb1c2524e706bbe2e5dc47a2de Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 8 May 2021 13:29:48 +0800 Subject: [PATCH 0209/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 28 ++--------- GithubEnhanced-High-Speed-Download.user.js | 57 ++++++++++------------ 2 files changed, 31 insertions(+), 54 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index aaffa09b3..d12b4c43d 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -131,30 +131,24 @@ // URL 匹配正则表达式 let patt_thread = /\/thread-\d+-\d+\-\d+.html/, - patt_thread_2 = /mod\=viewthread/, patt_forum = /\/forum-\d+-\d+\.html/, - patt_forum_2 = /mod\=forumdisplay/, - patt_guide = /mod\=guide\&view\=(hot|digest|new|newthread|my|tech|help)/, - patt_guide_newthread = /mod\=guide\&view\=newthread/, - patt_collection = /mod\=collection/ + patt_guide = /mod\=guide\&view\=(hot|digest|new|newthread|my|tech|help)/ // URL 判断 - if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)) { + if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1) { if (menu_value('menu_thread_pageLoading')) { curSite = DBSite.thread; // 帖子内 hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 } - } else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)) { + } else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1) { curSite = DBSite.forum; // 各板块帖子列表 } else if (patt_guide.test(location.search)) { curSite = DBSite.guide; // 导读帖子列表 delateReward(); // 屏蔽导读悬赏贴(最新发表) - } else if (patt_collection.test(location.search)) { + } else if (location.search.indexOf('mod=collection') > -1) { curSite = DBSite.collection; // 淘贴列表 } else if (location.pathname === '/search.php') { curSite = DBSite.search; // 搜索结果列表 - /*}else if(location.href === "https://www.52pojie.cn/home.php?mod=task&do=draw&id=2"){ - window.opener=null;window.open('','_self');window.close(); // 签到完成页面,关闭该标签页*/ } curSite.pageUrl = ""; // 下一页URL @@ -186,18 +180,6 @@ } - // 自动签到 - /*function qianDao() { - if (!menu_value('menu_autoClockIn')) return - let qiandao = document.querySelector('#um p:last-child a:first-child'); - if (qiandao && qiandao.href === "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"){ - window.GM_openInTab(qiandao.href, {active: false,insert: true,setParent: true}) // 后台打开签到地址 - qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] - qiandao.href = "#" // 修改 URL 为 # - } - }*/ - - // 自动签到(后台) function qianDao() { if (!menu_value('menu_autoClockIn')) return @@ -225,7 +207,7 @@ //屏蔽悬赏贴(导读-最新发表) function delateReward() { if (!menu_value('menu_delateReward')) return - if (patt_guide_newthread.test(location.search)) { + if (location.search.indexOf('mod=guide&view=newthread') > -1) { let tbody = document.querySelectorAll('#threadlist tbody[id^="normalthread"]'); Array.from(tbody).forEach(function (_this) { if (_this.querySelector('img[alt="悬赏"]')) { diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 298e5759e..aeb779f32 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -20,11 +20,11 @@ (function() { var backColor = '#ffffff'; var fontColor = '#888888'; - if(document.getElementsByTagName('html')[0].getAttribute('data-color-mode') == 'dark'){ // 黑暗模式判断 - if(document.getElementsByTagName('html')[0].getAttribute('data-dark-theme') == 'dark_dimmed'){ + if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') == 'dark') { // 黑暗模式判断 + if (document.getElementsByTagName('html')[0].getAttribute('data-dark-theme') == 'dark_dimmed') { backColor = '#272e37'; fontColor = '#768390'; - }else{ + } else { backColor = '#161a21'; fontColor = '#b2b8bf'; } @@ -62,12 +62,12 @@ registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { - if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 + if (menu_feedBack_ID) { // 如果反馈菜单ID不是 null,则删除所有脚本菜单 GM_unregisterMenuCommand(menu_menu_raw_fast_ID); GM_unregisterMenuCommand(menu_feedBack_ID); menu_raw_fast = GM_getValue('xiu2_menu_raw_fast'); } - if(menu_raw_fast > raw_url.length - 1){ // 避免在减少 raw 数组后,用户储存的数据大于数组而报错 + if (menu_raw_fast > raw_url.length - 1) { // 避免在减少 raw 数组后,用户储存的数据大于数组而报错 menu_raw_fast = 0 } menu_menu_raw_fast_ID = GM_registerMenuCommand(`🔄 [ ${raw_url[menu_raw_fast][1]} ] 加速源 (☁) - 点击切换`, menu_toggle_raw_fast); @@ -76,9 +76,9 @@ // 切换加速源 function menu_toggle_raw_fast() { - if (menu_raw_fast >= raw_url.length - 1){ // 如果当前加速源位置大于等于加速源总数,则改为第一个加速源,反之递增下一个加速源 + if (menu_raw_fast >= raw_url.length - 1) { // 如果当前加速源位置大于等于加速源总数,则改为第一个加速源,反之递增下一个加速源 menu_raw_fast = 0; - }else{ + } else { menu_raw_fast += 1; } GM_setValue('xiu2_menu_raw_fast', menu_raw_fast); @@ -113,7 +113,7 @@ // Release - function addRelease(){ + function addRelease() { let html = document.getElementsByClassName('Box Box--condensed');if (!html) return Array.from(html).forEach(function (current) { current.querySelectorAll('.d-flex.Box-body > a').forEach(function (_this) { @@ -127,8 +127,7 @@ download_url[5][0] + '/' + _this.href ], _html = `
    `; - for (let i=0;i${download_url[i][1]}` } _html += `
    ` @@ -150,8 +149,7 @@ download_url[5][0] + '/' + _this.href ], _html = `
    `; - for (let i=0;i${download_url[i][1]}` } _html += `
    ` @@ -164,7 +162,7 @@ // Download ZIP - function addDownloadZIP(){ + function addDownloadZIP() { let html = document.querySelector('.dropdown-menu.dropdown-menu-sw.p-0 ul li:last-child');if (!html) return let href = html.getElementsByTagName('a')[0].href, url = [ @@ -176,8 +174,7 @@ download_url[5][0] + '/' + href ], _html = ``; - for (let i=0;i${svg[0]}Download ZIP ${download_url[i][1]}` } html.insertAdjacentHTML('afterend', _html); @@ -185,7 +182,7 @@ // Git Clone - function addGitClone(){ + function addGitClone() { let html = document.querySelector('[role="tabpanel"] div.input-group');if (!html) return let href_split = html.querySelector('input').getAttribute('value').split('github.com'), url = [ @@ -194,8 +191,7 @@ clone_url[2][0] + href_split[1] ], _html = ``; - for (let i=0;i
    ${svg[1]}
    ` } html.insertAdjacentHTML('afterend', _html); @@ -203,7 +199,7 @@ // Raw - function addRawFile(){ + function addRawFile() { let html = document.getElementById('raw-url');if (!html) return let href = location.href.replace('https://github.com',''), href2 = href.replace('/blob/','/'), @@ -213,8 +209,7 @@ raw_url[3][0] + "/" + raw_url[0][0] + href2 ], _html = ``; - for (let i=0;i${raw_url[i+1][1]}` } html.insertAdjacentHTML('afterend', _html); @@ -222,13 +217,13 @@ // 添加 Raw 下载链接(☁) - function addRawDownLink(){ + function addRawDownLink() { // 如果不是项目文件页面,就返回,如果网页有 Raw 下载链接(☁)就返回 let files = document.querySelectorAll('div.Box-row svg.octicon.octicon-file');if(files.length === 0) return; let files1 = document.querySelectorAll('a.fileDownLink');if(files1.length > 0) return; // 鼠标指向则显示 - var mouseOverHandler = function(evt){ + var mouseOverHandler = function(evt) { let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); @@ -237,7 +232,7 @@ }; // 鼠标离开则隐藏 - var mouseOutHandler = function(evt){ + var mouseOutHandler = function(evt) { let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); @@ -246,7 +241,7 @@ }; // 循环添加 - files.forEach(function(fileElm, i){ + files.forEach(function(fileElm, i) { let trElm = fileElm.parentNode.parentNode, cntElm_a = trElm.querySelector('.css-truncate.css-truncate-target.d-block.width-fit a'), cntElm_svg = trElm.querySelector('.mr-3.flex-shrink-0 svg.octicon.octicon-file.color-icon-tertiary'), @@ -280,22 +275,22 @@ // 删除 Raw 快捷下载(☁) - function delRawDownLink(){ + function delRawDownLink() { let aElm = document.querySelectorAll('.fileDownLink');if(aElm.length === 0) return; - aElm.forEach(function(fileElm){ + aElm.forEach(function(fileElm) { fileElm.remove() }) } // 在浏览器返回/前进时重新添加 Raw 下载链接(☁)鼠标事件 - function addRawDownLink_(){ + function addRawDownLink_() { // 如果不是项目文件页面,就返回,如果网页没有 Raw 下载链接(☁)就返回 let files = document.querySelectorAll('div.Box-row svg.octicon.octicon-file');if(files.length === 0) return; let files1 = document.querySelectorAll('a.fileDownLink');if(files1.length === 0) return; // 鼠标指向则显示 - var mouseOverHandler = function(evt){ + var mouseOverHandler = function(evt) { let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); @@ -304,7 +299,7 @@ }; // 鼠标离开则隐藏 - var mouseOutHandler = function(evt){ + var mouseOutHandler = function(evt) { let elem = evt.currentTarget, aElm_new = elem.querySelectorAll('.fileDownLink'), aElm_now = elem.querySelectorAll('svg.octicon.octicon-file.color-icon-tertiary'); @@ -313,7 +308,7 @@ }; // 循环添加 - files.forEach(function(fileElm, i){ + files.forEach(function(fileElm, i) { let trElm = fileElm.parentNode.parentNode; // 绑定鼠标事件 trElm.onmouseover = mouseOverHandler; From 244ca7ed24730760c9fdd804a8fad095b51d8f8f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 8 May 2021 13:36:01 +0800 Subject: [PATCH 0210/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 15 +++++---------- Hostloc-Enhanced.user.js | 6 ++---- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index ba5c63baf..c1f5ad0da 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -131,31 +131,26 @@ // URL 匹配正则表达式 let patt_thread = /\/thread-\d+-\d+\-\d+.html/, - patt_thread_2 = /mod\=viewthread/, patt_forum = /\/forum-\d+-\d+\.html/, - patt_forum_2 = /mod\=forumdisplay/, - patt_guide = /mod\=guide\&view\=(hot|digest)/, - patt_reply = /mod\=post&action\=reply/, - patt_reply_2 = /extra\=page\%3D1&page\=/ + patt_guide = /mod\=guide\&view\=(hot|digest)/ // URL 判断 - if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){ + if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1){ // 帖子内 if(menu_value('menu_thread_pageLoading'))curSite = DBSite.thread; if(menu_value('menu_autoReply'))autoReply(); // 如果有隐藏内容,则自动回复 - pageLoading(); // 自动翻页 if(menu_value('menu_scrollToShowhide'))setTimeout(function(){window.scrollTo(0,document.querySelector('.showhide').offsetTop)}, 500); // 滚动至隐藏内容 - }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ + }else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ // 各板块帖子列表 curSite = DBSite.forum; if(menu_value('menu_cleanTopPost'))cleanTopPost(); // 清理置顶帖子 - pageLoading(); // 自动翻页 }else if (patt_guide.test(location.search)){ // 导读帖子列表 curSite = DBSite.guide; - pageLoading(); // 自动翻页 } + pageLoading(); // 自动翻页 + // 判断是否登陆 function checkLogin(){ diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 0963e194a..f69f9eacf 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -109,18 +109,16 @@ // URL 匹配正则表达式 let patt_thread = /\/thread-\d+-\d+\-\d+.html/, - patt_thread_2 = /mod\=viewthread/, patt_forum = /\/forum-\d+-\d+\.html/, - patt_forum_2 = /mod\=forumdisplay/, patt_guide = /mod\=guide\&view\=(hot|digest)/ // URL 判断 - if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){ + if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1){ // 帖子内 if(menu_value('menu_thread_pageLoading'))curSite = DBSite.thread; // 自动显示帖子内被隐藏的回复 showPosts(); - }else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){ + }else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ // 各板块帖子列表 curSite = DBSite.forum; }else if (patt_guide.test(location.search)){ From 17cbdca6fd4bdf7ee865a6b2afbdbc082779ce41 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 8 May 2021 22:22:46 +0800 Subject: [PATCH 0211/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 89a587021..06c80182e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ | :----: | :---- | :---- | :----: | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高度... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内容... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | -| [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、自动无缝翻页、回到顶部 (右键点击两侧空白处... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | +| [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、链接转图片、自动无缝翻页、新标签页打开链接... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 423Down、Apphot、不死鸟、小众软件、异次元软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | From 60c29d784f972f8ad21160166d940f4c8da2986e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 9 May 2021 14:15:57 +0800 Subject: [PATCH 0212/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index df1e2e43b..e89679b8d 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -4,7 +4,7 @@ // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* -// @match *://zhuanlan.zhihu.com/p/* +// @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand @@ -137,44 +137,34 @@ } .ImageMessage-ImageView { z-index: 999 !important; -} -`, +}`, style_2 = `/* 隐藏在各列表中查看文章时开头显示的大图,不影响文章、专栏页面 */ -.RichContent img.ArticleItem-image { - display: none !important; -} +.RichContent img.ArticleItem-image {display: none !important;} `, style_3 = `/* 调整文章编辑页面与实际文章宽度一致 */ -.PostEditor .RichText { - min-width: 690px !important; -} +.PostEditor .RichText {min-width: 690px !important;} /* 及标题输入框内的文字大小 */ -.WriteIndex-titleInput .Input { - min-width: 690px !important; - font-size: 24px; -} +.WriteIndex-titleInput .Input {min-width: 690px !important;font-size: 24px;} `, style_4 = `/* 向下翻时自动隐藏顶栏*/ -header.is-hidden { - display: none; -} +header.is-hidden {display: none;} `, style_5 = `/* 调整图片最大高度 */ -.ztext .content_image, .ztext .origin_image, .GifPlayer img { - max-height: 500px; - width: auto; -} +.ztext .content_image, .ztext .origin_image, .GifPlayer img {max-height: 500px;width: auto;} `, style_6 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ -html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content {color: #adbac7 !important;} +html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content, html[data-theme=dark] .Reward {color: #adbac7 !important;} /* 热榜标题 */ html[data-theme=dark] .HotItem-title {color: #c4cfda !important;} +/* 首页信息流标题 */ +html[data-theme=dark] .ContentItem-title a:hover, html[data-theme=dark] .RichContent.is-collapsed .RichContent-inner:hover, html[data-theme=dark] .ContentItem-more:hover {color: #c6d7ea !important;} + /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap {background: #2D333B !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag {background: #2D333B !important;} html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item {background-color: #222933 !important;} html[data-theme=dark] .CornerButton:hover {background: #3f4752 !important;} /* 右下角按钮 */ @@ -223,7 +213,7 @@ html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {backgr html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} /* 按钮颜色(蓝色) */ -.TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag, html[data-theme=dark] .HotListNav-item.is-active {color: #3faaff !important;} +.TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag, html[data-theme=dark] .HotListNav-item.is-active, html[data-theme=dark] .RichText a.UserLink-link {color: #3faaff !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ html[data-theme=dark] .Reward-rewardBtn {color: #ffffff !important;} `, From 28c1d3a8e497593f41ea1fbc36eb2a62255d211b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 9 May 2021 17:54:18 +0800 Subject: [PATCH 0213/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F=E4=B8=80/?= =?UTF-8?q?=E4=BA=8C=20=E9=83=A8=E5=88=86=20GIF=20=E5=8A=A8=E5=9B=BE?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=92=AD=E6=94=BE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index e89679b8d..e9d14ab02 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.16 +// @version 1.1.17 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -196,6 +196,8 @@ html[data-theme=dark] .PushNotifications-item a {color: #8ab5e0 !important;} html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.7 !important;} /* 其他图片 */ html[data-theme=dark] img {opacity: 0.9 !important;} +/* GIF 动图除外 */ +html[data-theme=dark] .GifPlayer img {opacity: 1 !important;} /* 边框 */ html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs, html[data-theme=dark] .Popover-arrow:after {border-bottom: 1px solid #282d35 !important;} @@ -220,6 +222,8 @@ html[data-theme=dark] .Reward-rewardBtn {color: #ffffff !important;} style_7 = `/* 暗黑模式(方案 2) */ html {filter: invert(80%) !important;} img, .ZVideoItem-video, .ZVideo-video {filter: invert(1) !important;} +.GifPlayer img, .GifPlayer.isPlaying video {filter: invert(1) !important;} +.GifPlayer.isPlaying img.ztext-gif.GifPlayer-gif2mp4Image {filter: none !important;} `, style_8 = `/* 暗黑模式(方案 3) */ html {filter: brightness(75%) !important;} From 284182af0d6e702979c401150429b92b70f52890 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 10 May 2021 16:50:14 +0800 Subject: [PATCH 0214/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=B8=8A?= =?UTF-8?q?=E4=B8=AA=E7=89=88=E6=9C=AC=E6=9B=B4=E6=96=B0=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80=E8=AF=84=E8=AE=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 81e0d2d3d..81d9118e4 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.3.9 +// @version 1.4.0 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -284,7 +284,7 @@ function blockUsers(type) { let item = e.target.getElementsByClassName('List-item')[0]; let listName = item.querySelector('.RichText.ztext.CopyrightRichText-richText b') // 用户名所在元素 if (listName) { - blockUsersList.forEach(function(item1){ // 遍历用户黑名单 + menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 if (item1 === listName.innerText) { // 找到就删除该搜索结果 console.log(listName.innerText); item.parentNode.remove(); @@ -359,8 +359,10 @@ function addEventListener_DOMNodeInserted() { // 知乎免登录,修改自:https://greasyfork.org/zh-CN/scripts/417126 let removeLoginModal = e => { if (e.target.innerHTML && e.target.getElementsByClassName('Modal-wrapper').length > 0) { - let button = e.target.getElementsByClassName('Button Modal-closeButton Button--plain')[0]; - if (button)button.click(); + if (e.target.getElementsByClassName('Modal-wrapper')[0].querySelector('.signFlowModal')){ + let button = e.target.getElementsByClassName('Button Modal-closeButton Button--plain')[0]; + if (button)button.click(); + } } } @@ -378,13 +380,19 @@ function addEventListener_DOMNodeInserted() { } } - if (document.querySelector('button.AppHeader-login')){ // 未登录时才会监听并移除登录弹窗 - document.addEventListener('DOMNodeInserted', removeLoginModal); - document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录] 按钮跳转至登录页面 - document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎] 按钮跳转至注册页面(实际上是同一个页面) - } else if(window.location.href.indexOf("zhuanlan") > -1){ - document.addEventListener('DOMNodeInserted', removeLoginModal); + // 未登录时才会监听并移除登录弹窗 + if(window.location.href.indexOf("zhuanlan") > -1) { // 如果是文章页 + if (!document.querySelector('button.ColumnPageHeader-MenuToggler')) { // 判断不存在,则已登录 + document.addEventListener('DOMNodeInserted', removeLoginModal); + } + } else { // 不是文章页 + if (document.querySelector('button.AppHeader-login')) { // 如果存在,则未登录 + document.addEventListener('DOMNodeInserted', removeLoginModal); + document.querySelector('button.AppHeader-login').onclick=function(){location.href='https://www.zhihu.com/signin';} // [登录] 按钮跳转至登录页面 + document.querySelector('.AppHeader-profile button.Button--primary').onclick=function(){location.href='https://www.zhihu.com/signin';} // [加入知乎] 按钮跳转至注册页面(实际上是同一个页面) + } } + document.addEventListener('DOMNodeInserted', collapseNowComment); // 收起当前评论(监听点击事件,点击网页两侧空白处) } From 59cf6c67939776c25af6c89d7881b181b843d229 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 10 May 2021 17:01:57 +0800 Subject: [PATCH 0215/2377] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=20[=E7=BE=8E=E5=9B=BD1]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index aeb779f32..b7284d297 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.5 +// @version 1.4.6 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -31,7 +31,6 @@ } var download_url = [ - ['https://gh.con.sh','美国'], ['https://gh.api.99988866.xyz','美国'], ['https://download.fastgit.org','日本东京'], ['https://gh.xiu2.xyz','日本东京'], @@ -120,11 +119,10 @@ let href = _this.href.split('github.com'), url = [ download_url[0][0] + '/' + _this.href, - download_url[1][0] + '/' + _this.href, - download_url[2][0] + href[1], + download_url[1][0] + href[1], + download_url[2][0] + '/' + _this.href, download_url[3][0] + '/' + _this.href, - download_url[4][0] + '/' + _this.href, - download_url[5][0] + '/' + _this.href + download_url[4][0] + '/' + _this.href ], _html = `
    `; for (let i=0;i`; for (let i=0;i Date: Mon, 10 May 2021 17:17:05 +0800 Subject: [PATCH 0216/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=BD=BD=E5=85=A5=E6=88=90=E5=8A=9F=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Beautification.user.js | 17 +++++++++++++---- 52pojie-Beautification.user.js | 18 +++++++++++------- Zhiyoo-Beautification.user.js | 15 ++++++++++++--- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/3dm-Beautification.user.js b/3dm-Beautification.user.js index 520bd3b00..fc451aa0b 100644 --- a/3dm-Beautification.user.js +++ b/3dm-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 3DM论坛美化 -// @version 1.0.0 +// @version 1.0.1 // @author X.I.U // @description 精简多余内容、样式优化 // @icon https://www.3dmgame.com/favicon.ico @@ -9,9 +9,9 @@ // @run-at document-start // @namespace https://greasyfork.org/scripts/413593 // ==/UserScript== - + (function() { - var style_Add = document.createElement('style'); + let style_Add = document.createElement('style'); style_Add.innerHTML = ` [url=home.php?mod=space&uid=945662]@media[/url] (min-width:1366px) { body { @@ -87,5 +87,14 @@ textarea#fastpostmessage { border-top: 0; border-bottom: 0; }`; - document.head.appendChild(style_Add); + if (document.head) { + document.head.appendChild(style_Add); + } else { + let timer = setInterval(function(){ + if (document.head) { + document.head.appendChild(style_Add); + clearInterval(timer); + } + }, 1); + } })(); \ No newline at end of file diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index 225ea8caf..2962f6a9b 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛美化 -// @version 1.0.7 +// @version 1.0.8 // @author X.I.U // @description 精简多余内容、样式优化 // @match *://www.52pojie.cn/* @@ -149,11 +149,15 @@ textarea#fastpostmessage { style = style_2 if (menu_value('menu_rule')) style += style_1; style_Add.innerHTML = style; - let timer = setInterval(function(){ - if (document.head) { - document.head.appendChild(style_Add); - clearInterval(timer); - } - }, 10); + if (document.head) { + document.head.appendChild(style_Add); + } else { + let timer = setInterval(function(){ + if (document.head) { + document.head.appendChild(style_Add); + clearInterval(timer); + } + }, 1); + } } })(); \ No newline at end of file diff --git a/Zhiyoo-Beautification.user.js b/Zhiyoo-Beautification.user.js index 06a711afa..e1bb66d9d 100644 --- a/Zhiyoo-Beautification.user.js +++ b/Zhiyoo-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 智友邦论坛美化 -// @version 1.0.1 +// @version 1.0.2 // @author X.I.U // @description 精简多余内容、样式优化、宽屏显示 // @icon http://bbs.zhiyoo.net/favicon.ico @@ -11,7 +11,7 @@ // ==/UserScript== (function() { - var style_Add = document.createElement('style'); + let style_Add = document.createElement('style'); style_Add.innerHTML = ` /* 精简多于内容 */ .forum_top,#main_sidebar,.drag,.nav,.tps,.bm.bml,.ct2 .sd,.mn div.box.cl:nth-of-type(3),#f_pst,.plc.plm,#diy_like1,#hm_qrcode_main,#ft,.po.bbd.reply_p,.ft_top.cl,div a[href="https://weibo.com/372458419"] { @@ -43,5 +43,14 @@ #postlist .pcb img { max-width: 30%; }`; - document.head.appendChild(style_Add); + if (document.head) { + document.head.appendChild(style_Add); + } else { + let timer = setInterval(function(){ + if (document.head) { + document.head.appendChild(style_Add); + clearInterval(timer); + } + }, 1); + } })(); \ No newline at end of file From de2853efb1c310820e9af6c79c1acc484b13754d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 11 May 2021 09:27:16 +0800 Subject: [PATCH 0217/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E5=BD=93=E5=89=8D=E8=AF=84=E8=AE=BA]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88=E5=AE=8C=E5=96=84=E4=BD=8D=E4=BA=8E=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=8C=BA=E6=9C=AB=E7=AB=AF=E6=97=B6=E6=94=B6=E8=B5=B7?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 81d9118e4..0854001c8 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.4.0 +// @version 1.4.1 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -128,7 +128,7 @@ function collapsedNowAnswer(selectors) { } } - var commentCollapseButton_ = false; + var commentCollapseButton_ = false, commentCollapseButton__ = false; // 悬浮的 [收起评论](此时正在浏览评论内容 [中间区域]) let commentCollapseButton = document.querySelector('.CommentCollapseButton') if (commentCollapseButton) { @@ -154,11 +154,27 @@ function collapsedNowAnswer(selectors) { let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('.ContentItem-actions > button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel:first-of-type') if (commentCollapseButton.innerText.indexOf('收起评论') > -1) { commentCollapseButton.click() + commentCollapseButton__ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 评论元素 时) break } } } } + if (commentCollapseButton__ == false) { // 如果上面的都没找到,那么就尝试寻找评论末尾的 [评论回复框] + let commentCollapseButton_2 = document.querySelectorAll('.CommentsV2-footer.CommentEditorV2--normal .CommentEditorV2-inputWrap') + if (commentCollapseButton_2.length > 0) { + for (let el of commentCollapseButton_2) { + if (isElementInViewport(el)) { + let commentCollapseButton = el.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('.ContentItem-actions > button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel:first-of-type') + console.log(commentCollapseButton) + if (commentCollapseButton.innerText.indexOf('收起评论') > -1) { + commentCollapseButton.click() + break + } + } + } + } + } } } } From c0b0c5b7b71cdc8a5d23aa56a6e811aa81059139 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 11 May 2021 18:23:35 +0800 Subject: [PATCH 0218/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=98=BE=E7=A4=BA=E6=9B=B4=E5=A4=9A=E6=96=87=E4=BB=B6?= =?UTF-8?q?]=20=E6=94=AF=E6=8C=81=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=96=B0=E7=89=88=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 55 +++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index c1b803472..93b7fa223 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.2.4 +// @version 1.2.5 // @author X.I.U // @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* @@ -83,11 +83,11 @@ } - if (document.getElementById("infos")) { // 分享链接文件列表页 - if (document.getElementById("pwdload")) { // 分享链接输入密码页 - enterToPass(); // 输入密码后回车确认 + if (document.getElementById("infos")) { // 分享链接文件列表页 + if (document.getElementById("pwdload")) { // 分享链接输入密码页 + enterToPass(); // 输入密码后回车确认 } - setTimeout(fileMoreS, 300); // 自动显示更多文件 + setTimeout(fileMoreS, 300); // 自动显示更多文件 } else if (document.querySelector("iframe.ifr2")) { // 分享链接文件下载页(暂时没有这方面的功能,先空着) //console.log() } else if (document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1) { // 后台页 @@ -194,13 +194,46 @@ // 自动显示更多文件(分享链接列表页) function fileMoreS() { - let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 - if(filemore && filemore.style.display != "none"){ // 判断按钮是否存在且可见 - filemore.click(); // 点击 [显示更多文件] 按钮 + if (document.getElementById("fileview")) { // 新版页面 + windowScroll(function (direction, e) { + if (direction === "down") { // 下滑才准备加载更多 + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + let scrollDelta = 500; + if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { + let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 + if (filemore && filemore.style.display != "none") { // 如果正在加载,就不再点击 + if (filemore.innerText.indexOf('更多') > -1){ // 避免已经在加载了,重复点击 + filemore.click(); // 点击 [显示更多文件] 按钮 + } + } + } + } + }); + } else { // 旧版页面 + let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 + if(filemore && filemore.style.display != "none"){ // 判断按钮是否存在且可见 + filemore.click(); // 点击 [显示更多文件] 按钮 + } } } + // 滚动条事件 + function windowScroll(fn1) { + var beforeScrollTop = document.documentElement.scrollTop, + fn = fn1 || function () {}; + setTimeout(function () { // 延时执行,避免刚载入到页面就触发翻页事件 + window.addEventListener("scroll", function (e) { + var afterScrollTop = document.documentElement.scrollTop, + delta = afterScrollTop - beforeScrollTop; + if (delta == 0) return false; + fn(delta > 0 ? "down" : "up", e); + beforeScrollTop = afterScrollTop; + }, false); + }, 1000) + } + + // 调整话说编辑框初始大小 function folderDescdes() { if(menu_value('menu_folderDescdesMenu')) { @@ -231,6 +264,12 @@ mainframe.f_upc(); } }, false); + mainframe.addEventListener("drop", function (e) { + e.preventDefault(); + //e.stopPropagation(); + console.log('111111') + //console.log(e.dataTransfer.files) + }); } From 0ebb1d8c4e48bc11896e868656d9b46adec71907 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 11 May 2021 18:27:57 +0800 Subject: [PATCH 0219/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E9=93=BE=E6=8E=A5=E9=A1=B5=20[=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=9B=B4=E5=A4=9A=E6=96=87=E4=BB=B6]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 93b7fa223..2a2db6c45 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.2.5 +// @version 1.2.6 // @author X.I.U // @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* @@ -194,27 +194,20 @@ // 自动显示更多文件(分享链接列表页) function fileMoreS() { - if (document.getElementById("fileview")) { // 新版页面 - windowScroll(function (direction, e) { - if (direction === "down") { // 下滑才准备加载更多 - let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; - let scrollDelta = 500; - if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { - let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 - if (filemore && filemore.style.display != "none") { // 如果正在加载,就不再点击 - if (filemore.innerText.indexOf('更多') > -1){ // 避免已经在加载了,重复点击 - filemore.click(); // 点击 [显示更多文件] 按钮 - } + windowScroll(function (direction, e) { + if (direction === "down") { // 下滑才准备加载更多 + let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; + let scrollDelta = 500; + if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { + let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 + if (filemore && filemore.style.display != "none") { // 如果正在加载,就不再点击 + if (filemore.innerText.indexOf('更多') > -1){ // 避免已经在加载了,重复点击 + filemore.click(); // 点击 [显示更多文件] 按钮 } } } - }); - } else { // 旧版页面 - let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮 - if(filemore && filemore.style.display != "none"){ // 判断按钮是否存在且可见 - filemore.click(); // 点击 [显示更多文件] 按钮 } - } + }); } From a4a6e9bdaa7d3e7ccd1f2757d571dec5f1a340f2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 11 May 2021 19:06:26 +0800 Subject: [PATCH 0220/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E5=BC=80=E5=90=AF=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 100 ++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 37 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index e9d14ab02..a0fc18e0c 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.17 +// @version 1.1.18 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -66,7 +66,7 @@ if (menu_status === 1) { // 设置 Cookie if (getTheme() === 'light') document.cookie="theme=dark; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; } else { - if (getTheme() === 'dark') document.cookie="theme=light; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + if (getTheme() === 'dark') document.cookie="theme=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; } if (menu_value('menu_darkMode')) { location.reload(); // 刷新网页 @@ -82,7 +82,7 @@ GM_setValue(`${Name}`, false); if (Name === 'menu_darkMode') { // 暗黑模式 - if (getTheme() === 'dark') document.cookie="theme=light; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + if (getTheme() === 'dark') document.cookie="theme=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; location.reload(); // 刷新网页 } else { GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); @@ -94,7 +94,7 @@ if (menu_value('menu_darkModeType') === 1) { if (getTheme() === 'light') document.cookie="theme=dark; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; } else { - if (getTheme() === 'dark') document.cookie="theme=light; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + if (getTheme() === 'dark') document.cookie="theme=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; } location.reload(); // 刷新网页 } else { @@ -152,7 +152,7 @@ header.is-hidden {display: none;} style_5 = `/* 调整图片最大高度 */ .ztext .content_image, .ztext .origin_image, .GifPlayer img {max-height: 500px;width: auto;} `, - style_6 = `/* 暗黑模式(方案 1) */ + style_darkMode_1 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content, html[data-theme=dark] .Reward {color: #adbac7 !important;} /* 热榜标题 */ @@ -164,7 +164,7 @@ html[data-theme=dark] .ContentItem-title a:hover, html[data-theme=dark] .RichCon /* 背景颜色 - 网页 */ html[data-theme=dark] body {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag {background: #2D333B !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag, html[data-theme=dark] .HoverCard, html[data-theme=dark] .HoverCard-loading {background: #2D333B !important;} html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item {background-color: #222933 !important;} html[data-theme=dark] .CornerButton:hover {background: #3f4752 !important;} /* 右下角按钮 */ @@ -218,21 +218,61 @@ html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} .TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag, html[data-theme=dark] .HotListNav-item.is-active, html[data-theme=dark] .RichText a.UserLink-link {color: #3faaff !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ html[data-theme=dark] .Reward-rewardBtn {color: #ffffff !important;} + +/* 关闭查看回复时的高闪 */ +html[data-theme=dark] .CommentItemV2--highlighted {-webkit-animation: nano !important;animation: nano !important;} `, - style_7 = `/* 暗黑模式(方案 2) */ + style_darkMode_2 = `/* 暗黑模式(方案 2) */ html {filter: invert(80%) !important;} img, .ZVideoItem-video, .ZVideo-video {filter: invert(1) !important;} .GifPlayer img, .GifPlayer.isPlaying video {filter: invert(1) !important;} .GifPlayer.isPlaying img.ztext-gif.GifPlayer-gif2mp4Image {filter: none !important;} `, - style_8 = `/* 暗黑模式(方案 3) */ + style_darkMode_3 = `/* 暗黑模式(方案 3) */ html {filter: brightness(75%) !important;} `, - style_9 = `/* 暗黑模式(方案 4) */ + style_darkMode_4 = `/* 暗黑模式(方案 4) */ html {filter: brightness(75%) sepia(30%) !important;} ` let style_Add = document.createElement('style'); + // 暗黑模式 + if (menu_value('menu_darkMode')) { + if (menu_value('menu_darkModeType') === 1) { + if (getTheme() === 'light') { + document.cookie="theme=dark; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'dark'); + location.reload(); // 刷新网页 + } + } else { + if (getTheme() === 'dark') { + document.cookie="theme=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light'); + location.reload(); // 刷新网页 + } + } + switch(menu_value('menu_darkModeType')) { + case 1: + style += style_darkMode_1; + break; + case 2: + style += style_darkMode_2; + break; + case 3: + style += style_darkMode_3; + break; + case 4: + style += style_darkMode_4; + break; + } + } else { + if (getTheme() === 'dark'){ + document.cookie="theme=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; + document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light'); + location.reload(); // 刷新网页 + } + } + // 宽屏显示 if (menu_value('menu_widescreenDisplay')) { style += style_1; @@ -253,29 +293,6 @@ html {filter: brightness(75%) sepia(30%) !important;} style += style_4; } - // 暗黑模式 - if (menu_value('menu_darkMode')) { - switch(menu_value('menu_darkModeType')) { - case 1: - style += style_6; - if (getTheme() === 'light') { - document.cookie="theme=dark; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'dark') - location.reload(); // 刷新网页 - } - break; - case 2: - style += style_7; - break; - case 3: - style += style_8; - break; - case 4: - style += style_9; - break; - } - } - // 文章编辑页面与实际文章宽度一致 if(window.location.href.indexOf("zhuanlan") > -1){ if(window.location.href.indexOf("/edit") > -1){ @@ -284,14 +301,23 @@ html {filter: brightness(75%) sepia(30%) !important;} } style_Add.innerHTML = style; - document.head.appendChild(style_Add); + if (document.head) { + document.head.appendChild(style_Add); + } else { + let timer = setInterval(function(){ + if (document.head) { + document.head.appendChild(style_Add); + clearInterval(timer); + } + }, 1); + } } function getTheme() { - var name = "theme="; - var ca = document.cookie.split(';'); - for(var i=0; i Date: Tue, 11 May 2021 19:25:23 +0800 Subject: [PATCH 0221/2377] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E5=8A=A0?= =?UTF-8?q?=E9=80=9F=E6=BA=90=20[=E6=97=A5=E6=9C=AC=E4=B8=9C=E4=BA=AC]=20?= =?UTF-8?q?=E4=B8=BA=20[=E7=BE=8E=E5=9B=BD]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index b7284d297..fe9a3c4f2 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.6 +// @version 1.4.7 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -32,8 +32,8 @@ var download_url = [ ['https://gh.api.99988866.xyz','美国'], + ['https://gh.xiu2.xyz','美国'], ['https://download.fastgit.org','日本东京'], - ['https://gh.xiu2.xyz','日本东京'], ['https://ghproxy.com','韩国首尔'], ['https://pd.zwc365.com/seturl','中国香港'] ], @@ -119,8 +119,8 @@ let href = _this.href.split('github.com'), url = [ download_url[0][0] + '/' + _this.href, - download_url[1][0] + href[1], - download_url[2][0] + '/' + _this.href, + download_url[1][0] + '/' + _this.href, + download_url[2][0] + href[1], download_url[3][0] + '/' + _this.href, download_url[4][0] + '/' + _this.href ], @@ -140,8 +140,8 @@ let href = _this.href.split('github.com'), url = [ download_url[0][0] + '/' + _this.href, - download_url[1][0] + href[1], - download_url[2][0] + '/' + _this.href, + download_url[1][0] + '/' + _this.href, + download_url[2][0] + href[1], download_url[3][0] + '/' + _this.href, download_url[4][0] + '/' + _this.href ], @@ -164,8 +164,8 @@ let href = html.getElementsByTagName('a')[0].href, url = [ download_url[0][0] + "/" + href, - download_url[1][0] + href.split('github.com')[1], - download_url[2][0] + "/" + href, + download_url[1][0] + "/" + href, + download_url[2][0] + href.split('github.com')[1], download_url[3][0] + "/" + href, download_url[4][0] + '/' + href ], From 2f847c726f712c4816769ad796d0bee2648b3e04 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 11 May 2021 23:37:55 +0800 Subject: [PATCH 0222/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B8=A6?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=9A=84=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=BE=93=E5=AF=86=E7=A0=81]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD;=20=E4=BC=98=E5=8C=96=20=E8=84=9A=E6=9C=AC=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 56 ++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 2a2db6c45..a78a50e84 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.2.6 +// @version 1.2.7 // @author X.I.U -// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 +// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、带密码的分享链接自动输密码、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -83,19 +83,24 @@ } - if (document.getElementById("infos")) { // 分享链接文件列表页 - if (document.getElementById("pwdload")) { // 分享链接输入密码页 - enterToPass(); // 输入密码后回车确认 - } - setTimeout(fileMoreS, 300); // 自动显示更多文件 - } else if (document.querySelector("iframe.ifr2")) { // 分享链接文件下载页(暂时没有这方面的功能,先空着) - //console.log() - } else if (document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1) { // 后台页 + if (window.top.location.pathname === '/u' || window.top.location.pathname.indexOf('account.php') > -1 || window.top.location.pathname.indexOf('mydisk.php') > -1) { // 后台页 if (window.top.location.href != "https://pc.woozooo.com/mydisk.php") { window.top.location.href = "https://pc.woozooo.com/mydisk.php" } var mainframe; iframe(); + } else if (window.top.location.pathname.indexOf('%') > -1) { // 带密码的分享链接页面 + shareLinkWithPassword(); // 带密码的分享链接自动输密码 + } else { + setTimeout(function() { // 延迟 300 毫秒(避免网页还没加载完) + if (document.getElementById('infos')) { // 分享链接文件列表页 + if (document.getElementById('pwdload')) { // 分享链接输入密码页 + enterPassword(); // 自动输入密码(仅支持访问 带密码的分享链接 时) + enterToPass(); // 输入密码后回车确认 + } + fileMoreS(); // 自动显示更多文件 + } + }, 300); } @@ -117,6 +122,33 @@ } + // 带密码的分享链接自动输密码 + function shareLinkWithPassword() { + if (location.pathname.indexOf('%E5%AF%86%E7%A0%81') > -1) { + let shareLink = location.pathname.split('%') + if (shareLink.length > 0) { + shareLink = location.origin + shareLink[0] + let password = location.pathname.replace('%E5%AF%86%E7%A0%81',':').replace(/%([A-Z]|[0-9]){2}/ig, '').split(':') + if (password.length > 0) { + location.replace(shareLink + '?password=' + password[password.length - 1]) + } + } + } + } + + + // 自动输入密码(仅支持访问 带密码的分享链接 时) + function enterPassword() { + if (location.search.indexOf('?password=') > -1) { + let password = location.search.split('=') + if (password.length > 0) { + document.getElementById('pwd').value = password[password.length - 1] + document.getElementById('sub').click(); + } + } + } + + // 刷新不返回根目录(F5) function refreshCorrection() { document.onkeydown = mainframe.onkeydown = function (e) { @@ -372,10 +404,6 @@ } - // 定时执行(旧方法,每隔 100ms 执行一次,比较笨且浪费一丢丢性能,但优点是不会漏掉且反应更快) - //setInterval(fileMore,100); - - // 监听 XMLHttpRequest 事件并执行(新方法,只有在产生事件时才会执行 [自动显示更多文件],平时不会执行,更优雅~) function EventXMLHttpRequest() { var _send = mainframe.XMLHttpRequest.prototype.send From 9cbfcd5a29e7168414a5f7d9d7829b9407228e59 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 12 May 2021 09:42:40 +0800 Subject: [PATCH 0223/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20Firefox=20=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E4=B8=8B=E7=9A=84=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C?= =?UTF-8?q?=EF=BC=88=E4=B8=8E=20Chrome=20=E7=B3=BB=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E5=9F=BA=E6=9C=AC=E4=B8=80=E8=87=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index a0fc18e0c..f292605e6 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.1.18 +// @version 1.2.0 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -207,8 +207,11 @@ html[data-theme=dark] .InputLike {border: 1px solid #424b56 !important;} /* 滚动条 */ html[data-theme=dark] body::-webkit-scrollbar, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar, html[data-theme="dark"] .Messages-list::-webkit-scrollbar, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar, html[data-theme=dark] .CommentListV2::-webkit-scrollbar, .ChatListGroup-SectionContent::-webkit-scrollbar, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar {width: 6px !important;height: 1px !important;} html[data-theme=dark] body::-webkit-scrollbar-thumb, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar-thumb, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-thumb, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-thumb, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-thumb, .ChatListGroup-SectionContent::-webkit-scrollbar-thumb, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-thumb {background: #3f4752 !important;} -html[data-theme=dark] body::-webkit-scrollbar-track, .ChatListGroup-SectionContent::-webkit-scrollbar-track, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-track {background: #22272e !important;} -html[data-theme=dark] .MessagesBox::-webkit-scrollbar-track, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-track, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-track, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-track {background: #2d333b !important;} +html[data-theme=dark] body::-webkit-scrollbar-track {background: #22272e !important;} +html[data-theme=dark] .MessagesBox::-webkit-scrollbar-track, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-track, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-track, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-track, .ChatListGroup-SectionContent::-webkit-scrollbar-track, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-track {background: #2d333b !important;} + +html {scrollbar-width: thin; scrollbar-color: #3f4752 #22272e;} +.MessagesBox, .Messages-list, .PushNotifications-list, .CommentListV2, .ChatListGroup-SectionContent, .ChatSideBar-Search-ResultListWrap {scrollbar-width: thin; scrollbar-color: #3f4752 #2D333B;} /* 背景颜色 - 专栏/文章 */ html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {background: #22272E !important;} @@ -227,12 +230,24 @@ html {filter: invert(80%) !important;} img, .ZVideoItem-video, .ZVideo-video {filter: invert(1) !important;} .GifPlayer img, .GifPlayer.isPlaying video {filter: invert(1) !important;} .GifPlayer.isPlaying img.ztext-gif.GifPlayer-gif2mp4Image {filter: none !important;} +`, + style_darkMode_2_firefox = `/* 暗黑模式(方案 2) */ +html {filter: invert(80%) !important; background-image: url();} +img, .ZVideoItem-video, .ZVideo-video {filter: invert(1) !important;} +.GifPlayer img, .GifPlayer.isPlaying video {filter: invert(1) !important;} +.GifPlayer.isPlaying img.ztext-gif.GifPlayer-gif2mp4Image {filter: none !important;} `, style_darkMode_3 = `/* 暗黑模式(方案 3) */ html {filter: brightness(75%) !important;} +`, + style_darkMode_3_firefox = `/* 暗黑模式(方案 3) */ +html {filter: brightness(75%) !important; background-image: url();} `, style_darkMode_4 = `/* 暗黑模式(方案 4) */ html {filter: brightness(75%) sepia(30%) !important;} +`, + style_darkMode_4_firefox = `/* 暗黑模式(方案 4) */ +html {filter: brightness(75%) sepia(30%) !important; background-image: url();} ` let style_Add = document.createElement('style'); @@ -250,6 +265,11 @@ html {filter: brightness(75%) sepia(30%) !important;} document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light'); location.reload(); // 刷新网页 } + if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { + style_darkMode_2 = style_darkMode_2_firefox + style_darkMode_3 = style_darkMode_3_firefox + style_darkMode_4 = style_darkMode_4_firefox + } } switch(menu_value('menu_darkModeType')) { case 1: From 35d115fba5a4640bb3c777a9956ce22fb6c2380e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 12 May 2021 17:00:08 +0800 Subject: [PATCH 0224/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E7=BE=8E?= =?UTF-8?q?=E5=9B=BD]=20Release=20=E5=8A=A0=E9=80=9F=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index fe9a3c4f2..2a90289cc 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.7 +// @version 1.4.8 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -32,6 +32,7 @@ var download_url = [ ['https://gh.api.99988866.xyz','美国'], + ['https://github.91chifun.workers.dev','美国'], ['https://gh.xiu2.xyz','美国'], ['https://download.fastgit.org','日本东京'], ['https://ghproxy.com','韩国首尔'], @@ -120,9 +121,10 @@ url = [ download_url[0][0] + '/' + _this.href, download_url[1][0] + '/' + _this.href, - download_url[2][0] + href[1], - download_url[3][0] + '/' + _this.href, - download_url[4][0] + '/' + _this.href + download_url[2][0] + '/' + _this.href, + download_url[3][0] + href[1], + download_url[4][0] + '/' + _this.href, + download_url[5][0] + '/' + _this.href ], _html = `
    `; for (let i=0;i`; for (let i=0;i Date: Wed, 12 May 2021 17:38:01 +0800 Subject: [PATCH 0225/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[Git=20Clone=20S?= =?UTF-8?q?SH]=20=E5=8A=A0=E9=80=9F=EF=BC=88=E4=B8=AD=E5=9B=BD=E5=8C=97?= =?UTF-8?q?=E4=BA=AC=E3=80=81=E4=B8=AD=E5=9B=BD=E9=A6=99=E6=B8=AF=EF=BC=89?= =?UTF-8?q?;=20=E6=96=B0=E5=A2=9E=20[=E7=BE=8E=E5=9B=BD=E6=B4=9B=E6=9D=89?= =?UTF-8?q?=E7=9F=B6]=20Release=20=E5=8A=A0=E9=80=9F=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 116 ++++++++++++++------- 1 file changed, 76 insertions(+), 40 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 2a90289cc..5a9947bbe 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.8 +// @version 1.4.9 // @author X.I.U // @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -29,20 +29,25 @@ fontColor = '#b2b8bf'; } } - +//['https://github.91chifun.workers.dev','美国'], var download_url = [ ['https://gh.api.99988866.xyz','美国'], - ['https://github.91chifun.workers.dev','美国'], + ['https://gh.msx.workers.dev','美国'], ['https://gh.xiu2.xyz','美国'], + ['https://git.yumenaka.net','美国洛杉矶'], ['https://download.fastgit.org','日本东京'], ['https://ghproxy.com','韩国首尔'], ['https://pd.zwc365.com/seturl','中国香港'] ], clone_url = [ ['https://hub.fastgit.org','中国香港'], - ['https://gitclone.com','中国浙江杭州'], + ['https://gitclone.com','中国浙江'], ['https://github.com.cnpmjs.org','新加坡'] ], + clone_ssh_url = [ + ['git@git.zhlh6.cn','中国北京'], + ['git@hub.fastgit.org','中国香港'] + ], raw_url = [ ['https://raw.githubusercontent.com','Github 原生',''], ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。'], @@ -89,16 +94,18 @@ }; addRelease(); // Release 加速 - addDownloadZIP(); // Source Code 加速 - addGitClone(); // Download ZIP/Code(ZIP) 加速 + addDownloadZIP(); // Download ZIP 加速 + addGitClone(); // Git Clone 加速 + addGitCloneSSH(); // Git Clone SSH 加速 addRawFile(); // Raw 加速 setTimeout(addRawDownLink, 2000); // 添加 Raw 下载链接(☁),延迟 2 秒执行,避免被 pjax 刷掉 document.addEventListener('pjax:success',function(){ // pjax 事件发生后 addRelease(); // Release 加速 - addDownloadZIP(); // Source Code 加速 - addGitClone(); // Download ZIP/Code(ZIP) 加速 - addRawFile(); // 添加 Raw 加速按钮 + addDownloadZIP(); // Download ZIP 加速 + addGitClone(); // Git Clone 加速 + addGitCloneSSH(); // Git Clone SSH 加速 + addRawFile(); // Raw 加速 setTimeout(addRawDownLink, 2000); // 添加 Raw 下载链接(☁),延迟 2 秒执行,避免被 pjax 刷掉 }); @@ -118,15 +125,17 @@ Array.from(html).forEach(function (current) { current.querySelectorAll('.d-flex.Box-body > a').forEach(function (_this) { let href = _this.href.split('github.com'), - url = [ - download_url[0][0] + '/' + _this.href, - download_url[1][0] + '/' + _this.href, - download_url[2][0] + '/' + _this.href, - download_url[3][0] + href[1], - download_url[4][0] + '/' + _this.href, - download_url[5][0] + '/' + _this.href - ], + url = [], _html = `
    `; + + for (let i=0;i${download_url[i][1]}` } @@ -140,15 +149,17 @@ // Source Code current.querySelectorAll('.d-block.Box-body > a').forEach(function (_this) { let href = _this.href.split('github.com'), - url = [ - download_url[0][0] + '/' + _this.href, - download_url[1][0] + '/' + _this.href, - download_url[2][0] + '/' + _this.href, - download_url[3][0] + href[1], - download_url[4][0] + '/' + _this.href, - download_url[5][0] + '/' + _this.href - ], + url = [], _html = `
    `; + + for (let i=0;i${download_url[i][1]}` } @@ -165,15 +176,17 @@ function addDownloadZIP() { let html = document.querySelector('.dropdown-menu.dropdown-menu-sw.p-0 ul li:last-child');if (!html) return let href = html.getElementsByTagName('a')[0].href, - url = [ - download_url[0][0] + "/" + href, - download_url[1][0] + "/" + href, - download_url[2][0] + "/" + href, - download_url[3][0] + href.split('github.com')[1], - download_url[4][0] + "/" + href, - download_url[5][0] + '/' + href - ], + url = [], _html = ``; + + for (let i=0;i${svg[0]}Download ZIP ${download_url[i][1]}` } @@ -183,14 +196,19 @@ // Git Clone function addGitClone() { - let html = document.querySelector('[role="tabpanel"] div.input-group');if (!html) return - let href_split = html.querySelector('input').getAttribute('value').split('github.com'), - url = [ - clone_url[0][0] + href_split[1], - clone_url[1][0] + '/github.com' + href_split[1], - clone_url[2][0] + href_split[1] - ], + let html = document.querySelector('[role="tabpanel"]:nth-child(2) div.input-group');if (!html) return + let href_split = html.getElementsByTagName('input')[0].getAttribute('value').split('github.com'), + url = [], _html = ``; + + for (let i=0;i
    ${svg[1]}
    ` } @@ -198,6 +216,24 @@ } + // Git Clone SSH + function addGitCloneSSH() { + let html = document.querySelector('[role="tabpanel"]:nth-child(3) div.input-group');if (!html) return + let href_split = html.getElementsByTagName('input')[0].getAttribute('value').split(':'), + url = [], + _html = ``; + + for (let i=0;i
    ${svg[1]}
    ` + } + html.insertAdjacentHTML('afterend', _html); + } + + // Raw function addRawFile() { let html = document.getElementById('raw-url');if (!html) return From 287f548143664175a08c59d6b22ad648a91b9bc1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 12 May 2021 17:39:00 +0800 Subject: [PATCH 0226/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[Git=20Clone=20S?= =?UTF-8?q?SH]=20=E5=8A=A0=E9=80=9F=EF=BC=88=E4=B8=AD=E5=9B=BD=E5=8C=97?= =?UTF-8?q?=E4=BA=AC=E3=80=81=E4=B8=AD=E5=9B=BD=E9=A6=99=E6=B8=AF=EF=BC=89?= =?UTF-8?q?;=20=E6=96=B0=E5=A2=9E=20[=E7=BE=8E=E5=9B=BD=E6=B4=9B=E6=9D=89?= =?UTF-8?q?=E7=9F=B6]=20Release=20=E5=8A=A0=E9=80=9F=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 5a9947bbe..0d6ce4cf5 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -2,7 +2,7 @@ // @name Github 增强 - 高速下载 // @version 1.4.9 // @author X.I.U -// @description 高速下载 Git Clone、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) +// @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* // @match *://hub.fastgit.org/* // @icon https://i.loli.net/2021/03/30/ULV9XunaHesqGIR.png From 5f709db854f497a62f0445a5cade3801d2cc3563 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 12 May 2021 17:42:05 +0800 Subject: [PATCH 0227/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06c80182e..d8f052edb 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高度... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内容... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、链接转图片、自动无缝翻页、新标签页打开链接... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | -| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone/SSH、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 423Down、Apphot、不死鸟、小众软件、异次元软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子、自动滚动至隐藏... | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | From cd903e4d554d8d267a423b1f4d1495466c0fe4a3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 13 May 2021 08:59:18 +0800 Subject: [PATCH 0228/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 171 +++++++++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 172 insertions(+) create mode 100644 DarkMode.user.js diff --git a/DarkMode.user.js b/DarkMode.user.js new file mode 100644 index 000000000..a024f84b0 --- /dev/null +++ b/DarkMode.user.js @@ -0,0 +1,171 @@ +// ==UserScript== +// @name 暗黑模式 +// @version 1.0.0 +// @author X.I.U +// @description 最简单的全网通用暗黑模式 +// @match *://*/* +// @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png +// @grant GM_registerMenuCommand +// @grant GM_unregisterMenuCommand +// @grant GM_getValue +// @grant GM_setValue +// @noframes +// @license GPL-3.0 License +// @run-at document-start +// @namespace https://github.com/XIU2/UserScript +// ==/UserScript== + +(function() { + var menu_ALL = [ + ['menu_runDuringTheDay', '白天保持开启 (比晚上更亮一点)', '白天保持开启', true], + ['menu_darkModeType', '点击切换模式', '点击切换模式', 1] + ], menu_ID = []; + for (let i=0;i menu_ALL.length){ // 如果菜单ID数组多于菜单数组,说明不是首次添加菜单,需要卸载所有脚本菜单 + for (let i=0;i 3){ // 避免在减少 raw 数组后,用户储存的数据大于数组而报错 + menu_ALL[i][3] = 1; + GM_setValue('menu_darkModeType', menu_ALL[i][3]); + } + menu_ID[i] = GM_registerMenuCommand(`🔄 [ ${menu_ALL[i][3]} ] ${menu_ALL[i][1]}`, function(){menu_toggle(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`)}); + } else { + menu_ID[i] = GM_registerMenuCommand(`🌝 [ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); + } + } + menu_ID[menu_ID.length] = GM_registerMenuCommand('💬 反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412212/feedback', {active: true,insert: true,setParent: true});}); + } + + + // 切换暗黑模式 + function menu_toggle(menu_status, Name) { + menu_status = parseInt(menu_status) + if (menu_status >= 3){ + menu_status = 1; + } else { + menu_status += 1; + } + GM_setValue(`${Name}`, menu_status); + location.reload(); // 刷新网页 + }; + + + // 菜单开关 + function menu_switch(menu_status, Name, Tips) { + if (menu_status == 'true'){ + GM_setValue(`${Name}`, false); + GM_notification({text: `已关闭 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + }else{ + GM_setValue(`${Name}`, true); + GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); + } + registerMenuCommand(); // 重新注册脚本菜单 + }; + + + // 返回菜单值 + function menu_value(menuName) { + for (let menu of menu_ALL) { + if (menu[0] == menuName) { + return menu[3] + } + } + } + + + // 添加样式 + function addStyle() { + let grayLevel,rgbValueArry, + style_Add = document.createElement('style'), + hours = new Date().getHours(), + style = ``, + style_00 = `body {background-color: #ffffff !important;}`, + style_11 = `html {filter: brightness(80%) !important;}`, + style_11_firefox = `html {filter: brightness(80%) !important; background-image: url();}`, + style_12 = `html {filter: brightness(70%) !important;}`, + style_12_firefox = `html {filter: brightness(70%) !important; background-image: url();}`, + style_21 = `html {filter: brightness(85%) sepia(20%) !important;}`, + style_21_firefox = `html {filter: brightness(85%) sepia(20%) !important; background-image: url();}`, + style_22 = `html {filter: brightness(70%) sepia(30%) !important;}`, + style_22_firefox = `html {filter: brightness(70%) sepia(30%) !important; background-image: url();}`, + style_31 = `html {filter: invert(80%) !important;} img, video {filter: invert(1) !important;}`, + style_31_firefox = `html {filter: invert(80%) !important;} img, video {filter: invert(1) !important; background-image: url();}`; + + // 判断网页是否没有设置背景颜色(没有背景颜色会导致滤镜对背景颜色无效) + if (document.body) { + rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '); + grayLevel = rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2]; + if (grayLevel === "000") style += style_00 + } + + // Firefox 浏览器需要特殊对待 + if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { + style_11 = style_11_firefox + style_12 = style_12_firefox + style_21 = style_21_firefox + style_22 = style_22_firefox + style_31 = style_31_firefox + } + + // 白天(7点到19点) + if (hours > 6 || hours < 19) { + if (menu_value('menu_runDuringTheDay')) { + style_12 = style_11 + style_22 = style_21 + } else { + style_12 = style_22 = '' + } + } + + switch(menu_value('menu_darkModeType')) { + case 1: + style += style_12; + break; + case 2: + style += style_22; + break; + case 3: + style += style_31; + break; + } + style_Add.innerHTML = style; + if (document.head) { + document.head.appendChild(style_Add); + } else { // 为了避免脚本运行的时候 head 还没加载导致报错 + let timer = setInterval(function(){ + if (document.head) { + document.head.appendChild(style_Add); + clearInterval(timer); + } + }, 1); + } + + // 为了避免 body 还没加载导致无法检查是否设置背景颜色的备用措施 + if (!grayLevel) { + let timer2 = setInterval(function(){ + if (document.body) { + let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '), + style_Add1 = document.createElement('style'); + if (rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2] === "000") { + style_Add1.innerHTML = 'body {background-color: #ffffff !important;}'; + document.head.appendChild(style_Add1); + } + clearInterval(timer2); + } + }, 1); + } + } +})(); \ No newline at end of file diff --git a/README.md b/README.md index d8f052edb..84e93921b 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | +| [](https://github.com/XIU2) | **暗黑模式** | 最简单的全网通用暗黑模式 | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高度... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内容... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、链接转图片、自动无缝翻页、新标签页打开链接... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | From d9e3b3a666ebaf15b028dc659b8b317ab6eb332e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 13 May 2021 09:01:40 +0800 Subject: [PATCH 0229/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index a024f84b0..1f05323c8 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -25,7 +25,7 @@ } registerMenuCommand(); addStyle(); - + // 注册脚本菜单 function registerMenuCommand() { From dd5b120403c60f4f923f94b09aa4f5db098690ce Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 13 May 2021 11:14:51 +0800 Subject: [PATCH 0230/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84e93921b..f909bed9e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高度... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内容... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、链接转图片、自动无缝翻页、新标签页打开链接... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | -| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone/SSH、Release、Raw、Code(ZIP) 等文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | +| [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone/SSH、Release、Raw、Code(ZIP) 文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 423Down、Apphot、不死鸟、小众软件、异次元软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子、自动滚动至隐藏... | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | From becb0ce402bebf64aaaac36d21fb8c2b7ab3501b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 13 May 2021 11:40:03 +0800 Subject: [PATCH 0231/2377] =?UTF-8?q?=E6=94=B9=E4=B8=AA=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 1f05323c8..83d7a5a35 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,8 +1,8 @@ // ==UserScript== -// @name 暗黑模式 +// @name 护眼模式 // @version 1.0.0 // @author X.I.U -// @description 最简单的全网通用暗黑模式 +// @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_registerMenuCommand @@ -25,7 +25,7 @@ } registerMenuCommand(); addStyle(); - + // 注册脚本菜单 function registerMenuCommand() { diff --git a/README.md b/README.md index f909bed9e..08f87b94a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| [](https://github.com/XIU2) | **暗黑模式** | 最简单的全网通用暗黑模式 | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | +| [](https://github.com/XIU2) | **护眼模式** | 最简单的全网通用护眼模式、夜间模式、暗黑模式 | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高度... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内容... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、链接转图片、自动无缝翻页、新标签页打开链接... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | From 57d90f027487096b50683b784755184a1f9dee16 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 13 May 2021 11:56:33 +0800 Subject: [PATCH 0232/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E7=99=BD?= =?UTF-8?q?=E5=A4=A9=E4=BA=AE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 83d7a5a35..fb4f073f9 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -97,8 +97,8 @@ style_11_firefox = `html {filter: brightness(80%) !important; background-image: url();}`, style_12 = `html {filter: brightness(70%) !important;}`, style_12_firefox = `html {filter: brightness(70%) !important; background-image: url();}`, - style_21 = `html {filter: brightness(85%) sepia(20%) !important;}`, - style_21_firefox = `html {filter: brightness(85%) sepia(20%) !important; background-image: url();}`, + style_21 = `html {filter: brightness(80%) sepia(20%) !important;}`, + style_21_firefox = `html {filter: brightness(80%) sepia(20%) !important; background-image: url();}`, style_22 = `html {filter: brightness(70%) sepia(30%) !important;}`, style_22_firefox = `html {filter: brightness(70%) sepia(30%) !important; background-image: url();}`, style_31 = `html {filter: invert(80%) !important;} img, video {filter: invert(1) !important;}`, From 597b5469cac104f6c0c17f2bf7b4a305d7d2f389 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 13 May 2021 18:05:42 +0800 Subject: [PATCH 0233/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=BE=AE?= =?UTF-8?q?=E5=BD=93=E4=B8=8B=E8=BD=BD]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 6b9072045..bd01ccb25 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.2.0 +// @version 1.2.1 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -12,6 +12,7 @@ // @match *://www.appinn.com/*/*/ // @match *://www.appinn.com/?s=* // @match *://www.iplaysoft.com/* +// @match *://www.weidown.com/* // @match *://fitgirl-repacks.site/* // @match *://*.alphacoders.com/* // @match *://club.sanguosha.com/* @@ -184,6 +185,39 @@ replaceE: 'css;nav.navigation.paging-navigation', scrollDelta: 2000 } + }, + weidown: { + SiteTypeID: 14, + pager: { + type: 1, + nextLink: '//a[@class="nextpage"][@href]', + pageElement: 'css;.articleWrapper > .itemArticle, .articleWrapper > .richTextItem.search', + HT_insert: ['css;.articleWrapper', 3], + replaceE: 'css;#pageGroup', + scrollDelta: 1500 + } + }, + weidown_search: { + SiteTypeID: 14, + pager: { + type: 1, + nextLink: '//a[@class="nextpage"][@href]', + pageElement: 'css;.articleListWrapper > .richTextItem.search', + HT_insert: ['css;#pageGroup', 1], + replaceE: 'css;#pageGroup', + scrollDelta: 700 + } + }, + weidown_special: { + SiteTypeID: 14, + pager: { + type: 1, + nextLink: '//a[@class="nextpage"][@href]', + pageElement: 'css;.special > .item', + HT_insert: ['css;.special', 3], + replaceE: 'css;#pageGroup', + scrollDelta: 700 + } } }; @@ -208,6 +242,15 @@ curSite = DBSite.iplaysoft_postslist; } break; + case "www.weidown.com": + if (location.pathname.indexOf("/search/") > -1) { + curSite = DBSite.weidown_search; + } else if (location.pathname.indexOf("/special/") > -1) { + curSite = DBSite.weidown_special; + } else { + curSite = DBSite.weidown; + } + break; case "fitgirl-repacks.site": curSite = DBSite.fitgirl; break; From 288455893eb89337b7844bd119a826f398e272ba Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 13 May 2021 19:57:39 +0800 Subject: [PATCH 0234/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index fb4f073f9..df46649e0 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.0 +// @version 1.0.1 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -121,7 +121,7 @@ } // 白天(7点到19点) - if (hours > 6 || hours < 19) { + if (hours > 6 && hours < 19) { if (menu_value('menu_runDuringTheDay')) { style_12 = style_11 style_22 = style_21 From 09e44e66b7a6681098c74c4dbb944ee1048f0e34 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 14 May 2021 07:36:56 +0800 Subject: [PATCH 0235/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index f292605e6..b4f4ed31b 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.2.0 +// @version 1.2.1 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -154,23 +154,27 @@ header.is-hidden {display: none;} `, style_darkMode_1 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ -html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content, html[data-theme=dark] .Reward {color: #adbac7 !important;} +html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content, html[data-theme=dark] .Reward, html[data-theme=dark] .ChatSideBar-Search-Input input, html[data-theme=dark] input.Input {color: #adbac7 !important;} /* 热榜标题 */ html[data-theme=dark] .HotItem-title {color: #c4cfda !important;} /* 首页信息流标题 */ html[data-theme=dark] .ContentItem-title a:hover, html[data-theme=dark] .RichContent.is-collapsed .RichContent-inner:hover, html[data-theme=dark] .ContentItem-more:hover {color: #c6d7ea !important;} - +/* 搜索高亮红字 */ +html[data-theme=dark] .Highlight em {color: #c33c39 !important;} /* 背景颜色 - 网页 */ -html[data-theme=dark] body {background: #22272E !important;} +html[data-theme=dark] body, html[data-theme=dark] .Select-option:focus {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag, html[data-theme=dark] .HoverCard, html[data-theme=dark] .HoverCard-loading {background: #2D333B !important;} -html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item {background-color: #222933 !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag, html[data-theme=dark] .HoverCard, html[data-theme=dark] .HoverCard-loading, html[data-theme=dark] .ExploreSpecialCard, html[data-theme=dark] .ExploreHomePage-ContentSection-moreButton a, html[data-theme=dark] .ExploreRoundtableCard, html[data-theme=dark] .ExploreCollectionCard, html[data-theme=dark] .ExploreColumnCard {background: #2D333B !important;} +html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item, html[data-theme=dark] .AutoInviteItem-wrapper--desktop, html[data-theme=dark] .ExploreSpecialCard-contentTag, html[data-theme=dark] .ExploreCollectionCard-contentTypeTag {background-color: #222933 !important;} html[data-theme=dark] .CornerButton:hover {background: #3f4752 !important;} /* 右下角按钮 */ /* 背景颜色 - 引用 */ html[data-theme=dark] .ztext blockquote {color: #768390 !important;border-left: 3px solid #3b3b3b !important;} +/* 搜索框 */ +html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .ChatSideBar-Search-Input input {background: #333a44 !important;} + /* 加载动画 */ html[data-theme=dark] .PlaceHolder-bg {background: -webkit-gradient(linear,left top,right top,from(#22272e),color-stop(20%,#2d333b),color-stop(40%,#22272e),to(#22272e)) !important;background: linear-gradient(90deg,#22272e 0,#2d333b 20%,#22272e 40%,#22272e) !important;} html[data-theme=dark] .PlaceHolder-inner {background: #22272e !important;color: #2d333b !important;} @@ -182,13 +186,14 @@ html[data-theme=dark] .TextMessage-receiver, html[data-theme="dark"] .TextMessag html[data-theme=dark] .TextMessage-sender, html[data-theme=dark] .TextMessage-receiver {color: #dcdcdc !important;} /*html[data-theme=dark] .MessagesBox::-webkit-scrollbar {width: 0px !important;height: 0px !important;}*/ -html[data-theme=dark] .ToolBar, html[data-theme=dark] .Input-wrapper, html[data-theme=dark] .ClubTopPosts {border: none !important;} +html[data-theme=dark] .ToolBar, html[data-theme=dark] .Input-wrapper, html[data-theme=dark] .ClubTopPosts, html[data-theme=dark] .ChatSideBar-Search-Input input {border: none !important;} /* 私信网页 */ html[data-theme=dark] .ChatUserListItem .Chat-ActionMenuPopover-Button {background: -webkit-gradient(linear,left top,right top,from(rgba(18,18,18,0)),color-stop(20%,#22272e)) !important;background: linear-gradient(90deg,rgba(18,18,18,0),#22272e 20%) !important;} +html[data-theme=dark] .css-1j6tmrz {border: 2px solid #2d333b !important;} /* 选项鼠标指向时背景颜色 */ -html[data-theme=dark] .Messages-item:hover, html[data-theme=dark] .GlobalSideBar-navLink:hover, html[data-theme=dark] .Menu-item.is-active, html[data-theme=dark] .ActionMenu-item:hover, html[data-theme=dark] .ChatUserListItem--active {background-color: #272c33 !important;} +html[data-theme=dark] .Messages-item:hover, html[data-theme=dark] .GlobalSideBar-navLink:hover, html[data-theme=dark] .Menu-item.is-active, html[data-theme=dark] .ActionMenu-item:hover, html[data-theme=dark] .ChatUserListItem--active, html[data-theme=dark] .Messages-newItem {background-color: #272c33 !important;} /* 通知 */ html[data-theme=dark] .PushNotifications-item a {color: #8ab5e0 !important;} @@ -203,6 +208,9 @@ html[data-theme=dark] .GifPlayer img {opacity: 1 !important;} html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs, html[data-theme=dark] .Popover-arrow:after {border-bottom: 1px solid #282d35 !important;} html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .PostItem {border: none !important;} html[data-theme=dark] .InputLike {border: 1px solid #424b56 !important;} +html[data-theme=dark] .Popover .InputLike {border: 1px solid #2d333b !important;} + +html[data-theme=dark] .Popover-content, html[data-theme=dark] .Popover-arrow:after {border: 1px solid #22272e !important;} /* 滚动条 */ html[data-theme=dark] body::-webkit-scrollbar, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar, html[data-theme="dark"] .Messages-list::-webkit-scrollbar, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar, html[data-theme=dark] .CommentListV2::-webkit-scrollbar, .ChatListGroup-SectionContent::-webkit-scrollbar, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar {width: 6px !important;height: 1px !important;} @@ -217,10 +225,10 @@ html {scrollbar-width: thin; scrollbar-color: #3f4752 #22272e;} html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {background: #22272E !important;} html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} -/* 按钮颜色(蓝色) */ +/* 按钮颜色 */ .TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag, html[data-theme=dark] .HotListNav-item.is-active, html[data-theme=dark] .RichText a.UserLink-link {color: #3faaff !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ -html[data-theme=dark] .Reward-rewardBtn {color: #ffffff !important;} +html[data-theme=dark] .Reward-rewardBtn, html[data-theme=dark] .SearchBar-searchIcon.hasValue, html[data-theme=dark] .Chat-UnreadCount {color: #ffffff !important;} /* 关闭查看回复时的高闪 */ html[data-theme=dark] .CommentItemV2--highlighted {-webkit-animation: nano !important;animation: nano !important;} From f63692da6a19cee0e29816e18e4f56258d300041 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 14 May 2021 08:05:39 +0800 Subject: [PATCH 0236/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index b4f4ed31b..2e275dc5e 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -154,7 +154,8 @@ header.is-hidden {display: none;} `, style_darkMode_1 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ -html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content, html[data-theme=dark] .Reward, html[data-theme=dark] .ChatSideBar-Search-Input input, html[data-theme=dark] input.Input {color: #adbac7 !important;} +html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content, html[data-theme=dark] .Reward, html[data-theme=dark] .ChatSideBar-Search-Input input, html[data-theme=dark] input.Input, html[data-theme=dark] .LinkCard-title, html[data-theme=dark] .MCNLinkCard-title, html[data-theme=dark] .ZVideoLinkCard-title {color: #adbac7 !important;} +html[data-theme=dark] .LinkCard-meta, html[data-theme=dark] .MCNLinkCard-source {color: #5a6f83 !important;} /* 热榜标题 */ html[data-theme=dark] .HotItem-title {color: #c4cfda !important;} /* 首页信息流标题 */ @@ -172,6 +173,12 @@ html[data-theme=dark] .CornerButton:hover {background: #3f4752 !important;} /* /* 背景颜色 - 引用 */ html[data-theme=dark] .ztext blockquote {color: #768390 !important;border-left: 3px solid #3b3b3b !important;} +/* 背景颜色 - 卡片 */ +html[data-theme=dark] .MCNLinkCard, html[data-theme=dark] .LinkCard-content, html[data-theme=dark] .ZVideoLinkCard-info {background-color: #22272e !important;} +html[data-theme=dark] .Post-content .MCNLinkCard, html[data-theme=dark] .Post-content .LinkCard-content, html[data-theme=dark] .Post-content .ZVideoLinkCard-info {background-color: #2D333B !important;} +html[data-theme=dark] .LinkCard-backdrop {background-image: url() !important;} + + /* 搜索框 */ html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .ChatSideBar-Search-Input input {background: #333a44 !important;} @@ -223,7 +230,7 @@ html {scrollbar-width: thin; scrollbar-color: #3f4752 #22272e;} /* 背景颜色 - 专栏/文章 */ html[data-theme=dark] .WhiteBg-body, html[data-theme=dark] .Post-content {background: #22272E !important;} -html[data-theme=dark] .ColumnPageHeader {background: #1c2129 !important;} +html[data-theme=dark] .ColumnPageHeader, html[data-theme=dark] .BottomInfo {background: #1c2129 !important;} /* 按钮颜色 */ .TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag, html[data-theme=dark] .HotListNav-item.is-active, html[data-theme=dark] .RichText a.UserLink-link {color: #3faaff !important;} From c54e50b0c8dff2d4f8a22b6bb93d7aa04b34f10b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 14 May 2021 16:35:34 +0800 Subject: [PATCH 0237/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=B1=86?= =?UTF-8?q?=E7=93=A3]=20=E6=94=AF=E6=8C=81=EF=BC=88=E9=9B=86=E8=AF=84?= =?UTF-8?q?=E3=80=81=E7=9F=AD=E8=AF=84=E3=80=81=E5=BD=B1=E8=AF=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index bd01ccb25..505ee21d0 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.2.1 +// @version 1.2.2 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -18,6 +18,7 @@ // @match *://club.sanguosha.com/* // @match *://www.centbrowser.net/* // @match *://pubmed.ncbi.nlm.nih.gov/?term=* +// @match *://movie.douban.com/* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -218,6 +219,39 @@ replaceE: 'css;#pageGroup', scrollDelta: 700 } + }, + douban_subject_comments: { + SiteTypeID: 15, + pager: { + type: 1, + nextLink: '//a[@class="next"][@href]', + pageElement: 'css;#comments > .comment-item', + HT_insert: ['css;#paginator', 1], + replaceE: 'css;#paginator', + scrollDelta: 700 + } + }, + douban_subject_reviews: { + SiteTypeID: 16, + pager: { + type: 1, + nextLink: '//link[@rel="next"][@href]', + pageElement: 'css;.review-list > div', + HT_insert: ['css;.review-list', 3], + replaceE: 'css;.paginator', + scrollDelta: 700 + } + }, + douban_subject_episode: { + SiteTypeID: 17, + pager: { + type: 1, + nextLink: '//link[@rel="next"][@href]', + pageElement: 'css;#comments > div', + HT_insert: ['css;#comments', 3], + replaceE: 'css;.paginator', + scrollDelta: 700 + } } }; @@ -288,6 +322,15 @@ case "pubmed.ncbi.nlm.nih.gov": curSite = DBSite.pubmed_postslist; break; + case "movie.douban.com": + if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/comments') > -1) { // 短评 + curSite = DBSite.douban_subject_comments; + } else if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/reviews') > -1) { // 影评 + curSite = DBSite.douban_subject_reviews; + }else if(location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/episode') > -1) { // 电视剧每集评论 + curSite = DBSite.douban_subject_episode; + } + break; } curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动无缝翻页 From 187e33d4194f65e71612a3d13e9e67f8f2de5754 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 15 May 2021 01:04:41 +0800 Subject: [PATCH 0238/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E5=86=85=E7=BF=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index f69f9eacf..fe598b2b3 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.6 +// @version 1.0.7 // @author X.I.U // @description 自动无缝翻页、自动显示帖子内隐藏回复 // @match *://hostloc.com/* @@ -76,7 +76,7 @@ nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]', pageElement: 'css;div#postlist > div[id^="post_"]', HT_insert: ['css;div#postlist', 2], - replaceE: '//div[@class="pg"] | //div[@class="pgbtn"]', + replaceE: 'css;div.pg', } }, guide: { @@ -115,9 +115,11 @@ // URL 判断 if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1){ // 帖子内 - if(menu_value('menu_thread_pageLoading'))curSite = DBSite.thread; - // 自动显示帖子内被隐藏的回复 - showPosts(); + if(menu_value('menu_thread_pageLoading')) { + curSite = DBSite.thread; + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + } + showPosts(); // 自动显示帖子内被隐藏的回复 }else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ // 各板块帖子列表 curSite = DBSite.forum; @@ -167,6 +169,14 @@ } + // 隐藏帖子内的 [下一页] 按钮 + function hidePgbtn() { + let style_hidePgbtn = document.createElement('style'); + style_hidePgbtn.innerHTML = `.pgbtn {display: none;}`; + document.head.appendChild(style_hidePgbtn); + } + + // 滚动条事件 function windowScroll(fn1) { var beforeScrollTop = document.documentElement.scrollTop, From 5546902d15da584052eb8e32d8846cd179f9831f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 15 May 2021 18:37:18 +0800 Subject: [PATCH 0239/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 2e275dc5e..ea81d60fb 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.2.1 +// @version 1.2.2 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -154,20 +154,20 @@ header.is-hidden {display: none;} `, style_darkMode_1 = `/* 暗黑模式(方案 1) */ /* 文字颜色 */ -html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content, html[data-theme=dark] .Reward, html[data-theme=dark] .ChatSideBar-Search-Input input, html[data-theme=dark] input.Input, html[data-theme=dark] .LinkCard-title, html[data-theme=dark] .MCNLinkCard-title, html[data-theme=dark] .ZVideoLinkCard-title {color: #adbac7 !important;} +html[data-theme=dark] body, html[data-theme=dark] .ContentItem-title, html[data-theme=dark] .QuestionHeader-title, html[data-theme=dark] .Tabs-link, html[data-theme=dark] .CreatorEntrance-title, html[data-theme=dark] .Search-container, html[data-theme=dark] .HotItem-excerpt, html[data-theme=dark] .PushNotifications-item, html[data-theme=dark] .Notifications-Main>header h1, html[data-theme=dark] .Notifications-Section-header h2, html[data-theme=dark] .NotificationList-Item-content, html[data-theme=dark] .Reward, html[data-theme=dark] .ChatSideBar-Search-Input input, html[data-theme=dark] input.Input, html[data-theme=dark] .LinkCard-title, html[data-theme=dark] .MCNLinkCard-title, html[data-theme=dark] .ZVideoLinkCard-title, html[data-theme=dark] .TipjarDialog-customButton {color: #adbac7 !important;} html[data-theme=dark] .LinkCard-meta, html[data-theme=dark] .MCNLinkCard-source {color: #5a6f83 !important;} /* 热榜标题 */ html[data-theme=dark] .HotItem-title {color: #c4cfda !important;} /* 首页信息流标题 */ -html[data-theme=dark] .ContentItem-title a:hover, html[data-theme=dark] .RichContent.is-collapsed .RichContent-inner:hover, html[data-theme=dark] .ContentItem-more:hover {color: #c6d7ea !important;} +html[data-theme=dark] .ContentItem-title a:hover, html[data-theme=dark] .RichContent.is-collapsed .RichContent-inner:hover, html[data-theme=dark] .ContentItem-more:hover, html[data-theme=dark] .QuestionRichText--expandable.QuestionRichText--collapsed:hover {color: #b3c3d6 !important;} /* 搜索高亮红字 */ html[data-theme=dark] .Highlight em {color: #c33c39 !important;} /* 背景颜色 - 网页 */ html[data-theme=dark] body, html[data-theme=dark] .Select-option:focus {background: #22272E !important;} /* 背景颜色 - 问题 */ -html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag, html[data-theme=dark] .HoverCard, html[data-theme=dark] .HoverCard-loading, html[data-theme=dark] .ExploreSpecialCard, html[data-theme=dark] .ExploreHomePage-ContentSection-moreButton a, html[data-theme=dark] .ExploreRoundtableCard, html[data-theme=dark] .ExploreCollectionCard, html[data-theme=dark] .ExploreColumnCard {background: #2D333B !important;} -html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item, html[data-theme=dark] .AutoInviteItem-wrapper--desktop, html[data-theme=dark] .ExploreSpecialCard-contentTag, html[data-theme=dark] .ExploreCollectionCard-contentTypeTag {background-color: #222933 !important;} +html[data-theme=dark] .AppHeader, html[data-theme=dark] .QuestionHeader, html[data-theme=dark] .QuestionHeader-footer, html[data-theme=dark] .EmoticonsFooter-item--selected, html[data-theme=dark] .Card, html[data-theme=dark] .ContentItem-actions, html[data-theme=dark] .MoreAnswers .List-headerText, html[data-theme=dark] .CommentsV2-withPagination, html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .CommentEditorV2-inputWrap--active, html[data-theme=dark] .InputLike, html[data-theme=dark] .Popover-content, html[data-theme=dark] .Notifications-footer, html[data-theme=dark] .Messages-footer, html[data-theme=dark] .Modal-inner, html[data-theme=dark] .Emoticons, html[data-theme=dark] .EmoticonsFooter, html[data-theme=dark] .SearchTabs, html[data-theme=dark] .Popover-arrow:after, html[data-theme=dark] .CommentEditorV2-inputWrap, html[data-theme=dark] .ProfileHeader-wrapper, html[data-theme=dark] .UserCover, html[data-theme=dark] .AnswerForm-footer, html[data-theme=dark] .Editable-toolbar, html[data-theme=dark] .AnswerForm-fullscreenContent .Editable-toolbar, html[data-theme=dark] .KfeCollection-PcCollegeCard-wrapper, html[data-theme=dark] .KfeCollection-PcCollegeCard-root, html[data-theme=dark] .HotItem, html[data-theme=dark] .HotList, html[data-theme=dark] .HotListNavEditPad, html[data-theme=dark] .QuestionWaiting-typesTopper, html[data-theme=dark] .QuestionWaiting-types, html[data-theme=dark] .PostItem, html[data-theme=dark] .ClubSideBar section, html[data-theme=dark] .SearchSubTabs, html[data-theme=dark] .Club-SearchPosts-Content, html[data-theme=dark] .Club-content, html[data-theme=dark] .ClubJoinOrCheckinButton, html[data-theme=dark] .ClubEdit, html[data-theme=dark] .CornerButton, html[data-theme=dark] .Notifications-Section-header, html[data-theme=dark] .NotificationList, .NotificationList-Item.NotificationList-Item:after, .NotificationList-DateSplit.NotificationList-DateSplit:after, html[data-theme=dark] .Chat, .ChatUserListItem:after, .ChatListGroup-SectionTitle--bottomBorder:after, html[data-theme=dark] .ActionMenu, .ChatSideBar-Search--active, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap, html[data-theme=dark] .QuestionMainDivider-inner, html[data-theme=dark] .Topic-bar, html[data-theme=dark] .AnnotationTag, html[data-theme=dark] .HoverCard, html[data-theme=dark] .HoverCard-loading, html[data-theme=dark] .ExploreSpecialCard, html[data-theme=dark] .ExploreHomePage-ContentSection-moreButton a, html[data-theme=dark] .ExploreRoundtableCard, html[data-theme=dark] .ExploreCollectionCard, html[data-theme=dark] .ExploreColumnCard, html[data-theme=dark] .RichText .lazy[data-lazy-status] {background: #2D333B !important;} +html[data-theme=dark] .CommentListV2-header-divider, html[data-theme=dark] .CommentsV2-openComment-divider, html[data-theme=dark] .AnswerForm-fullscreenScroller, html[data-theme=dark] .HotListNav-item, html[data-theme=dark] .AutoInviteItem-wrapper--desktop, html[data-theme=dark] .ExploreSpecialCard-contentTag, html[data-theme=dark] .ExploreCollectionCard-contentTypeTag, html[data-theme=dark] .Reward-TipjarDialog-tagLine {background-color: #222933 !important;} html[data-theme=dark] .CornerButton:hover {background: #3f4752 !important;} /* 右下角按钮 */ /* 背景颜色 - 引用 */ @@ -178,6 +178,8 @@ html[data-theme=dark] .MCNLinkCard, html[data-theme=dark] .LinkCard-content, htm html[data-theme=dark] .Post-content .MCNLinkCard, html[data-theme=dark] .Post-content .LinkCard-content, html[data-theme=dark] .Post-content .ZVideoLinkCard-info {background-color: #2D333B !important;} html[data-theme=dark] .LinkCard-backdrop {background-image: url() !important;} +/* 通知信息中点评论链接时,在弹出的评论框中 "高亮" 目标评论 */ +html[data-theme=dark] .CommentItemV2[tabindex='-1'] {background-color: #343a44 !important;} /* 搜索框 */ html[data-theme=dark] .Input-wrapper.Input-wrapper--grey, html[data-theme=dark] .ChatSideBar-Search-Input input {background: #333a44 !important;} @@ -207,9 +209,9 @@ html[data-theme=dark] .PushNotifications-item a {color: #8ab5e0 !important;} /* 封面大图/文章头部大图 */ html[data-theme=dark] img.UserCover-image, html[data-theme=dark] img.TitleImage {opacity: 0.7 !important;} /* 其他图片 */ -html[data-theme=dark] img {opacity: 0.9 !important;} -/* GIF 动图除外 */ -html[data-theme=dark] .GifPlayer img {opacity: 1 !important;} +html[data-theme=dark] img {opacity: 0.8 !important;} +/* GIF 动图、放大图除外 */ +html[data-theme=dark] .GifPlayer img, html[data-theme=dark] .ImageView-img {opacity: 1 !important;} /* 边框 */ html[data-theme=dark] .Topbar, html[data-theme=dark] .CommentsV2-footer, html[data-theme=dark] .Topstory-mainColumnCard .Card:not(.Topstory-tabCard), html[data-theme=dark] .NestComment:not(:last-child):after, html[data-theme=dark] .NestComment--rootComment:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .NestComment .NestComment--child:after, html[data-theme=dark] .CommentsV2-replyNum, html[data-theme=dark] .CommentItemV2:not(:first-child):after, html[data-theme=dark] .Tabs, html[data-theme=dark] .Popover-arrow:after {border-bottom: 1px solid #282d35 !important;} @@ -235,10 +237,13 @@ html[data-theme=dark] .ColumnPageHeader, html[data-theme=dark] .BottomInfo {back /* 按钮颜色 */ .TopstoryTabs-link.is-active, html[data-theme=dark] .TopstoryTabs-link.is-active, html[data-theme=dark] .VoteButton, .Tag, html[data-theme=dark] .Tag, html[data-theme=dark] .HotListNav-item.is-active, html[data-theme=dark] .RichText a.UserLink-link {color: #3faaff !important;} /*html[data-theme=dark] .Tabs-link.is-active:after {background: #2196F3 !important;}*/ -html[data-theme=dark] .Reward-rewardBtn, html[data-theme=dark] .SearchBar-searchIcon.hasValue, html[data-theme=dark] .Chat-UnreadCount {color: #ffffff !important;} +html[data-theme=dark] .Reward-rewardBtn, html[data-theme=dark] .SearchBar-searchIcon.hasValue, html[data-theme=dark] .Chat-UnreadCount, html[data-theme=dark] .Payment-CheckedButton {color: #ffffff !important;} /* 关闭查看回复时的高闪 */ html[data-theme=dark] .CommentItemV2--highlighted {-webkit-animation: nano !important;animation: nano !important;} + +/* 赞赏 */ +html[data-theme=dark] .Reward-TipjarDialog-amountList .Button--red, html[data-theme=dark] .Reward-TipjarDialog-amountList .Button--red, html[data-theme=dark] .Reward-TipjarDialog-amountInput .SimpleInput {color: #d3d3d3 !important; background-color: #353b44 !important; border: none !important;} `, style_darkMode_2 = `/* 暗黑模式(方案 2) */ html {filter: invert(80%) !important;} From 54ef1677735bb31a59d22eb99ef5f8576569d955 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 16 May 2021 09:39:46 +0800 Subject: [PATCH 0240/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=9A=97?= =?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F]=20=E6=A0=B7=E5=BC=8F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index ea81d60fb..12309edc4 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.2.2 +// @version 1.2.3 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -197,6 +197,8 @@ html[data-theme=dark] .TextMessage-sender, html[data-theme=dark] .TextMessage-re /*html[data-theme=dark] .MessagesBox::-webkit-scrollbar {width: 0px !important;height: 0px !important;}*/ html[data-theme=dark] .ToolBar, html[data-theme=dark] .Input-wrapper, html[data-theme=dark] .ClubTopPosts, html[data-theme=dark] .ChatSideBar-Search-Input input {border: none !important;} +html[data-theme=dark] .ChatBoxModal-closeIcon {fill: #8590a6 !important;} + /* 私信网页 */ html[data-theme=dark] .ChatUserListItem .Chat-ActionMenuPopover-Button {background: -webkit-gradient(linear,left top,right top,from(rgba(18,18,18,0)),color-stop(20%,#22272e)) !important;background: linear-gradient(90deg,rgba(18,18,18,0),#22272e 20%) !important;} html[data-theme=dark] .css-1j6tmrz {border: 2px solid #2d333b !important;} @@ -222,10 +224,10 @@ html[data-theme=dark] .Popover .InputLike {border: 1px solid #2d333b !important; html[data-theme=dark] .Popover-content, html[data-theme=dark] .Popover-arrow:after {border: 1px solid #22272e !important;} /* 滚动条 */ -html[data-theme=dark] body::-webkit-scrollbar, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar, html[data-theme="dark"] .Messages-list::-webkit-scrollbar, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar, html[data-theme=dark] .CommentListV2::-webkit-scrollbar, .ChatListGroup-SectionContent::-webkit-scrollbar, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar {width: 6px !important;height: 1px !important;} -html[data-theme=dark] body::-webkit-scrollbar-thumb, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar-thumb, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-thumb, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-thumb, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-thumb, .ChatListGroup-SectionContent::-webkit-scrollbar-thumb, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-thumb {background: #3f4752 !important;} +html[data-theme=dark] body::-webkit-scrollbar, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar, html[data-theme="dark"] .Messages-list::-webkit-scrollbar, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar, html[data-theme=dark] .CommentListV2::-webkit-scrollbar, .ChatListGroup-SectionContent::-webkit-scrollbar, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar, html[data-theme=dark] .ChatBox textarea.Input::-webkit-scrollbar {width: 6px !important;height: 1px !important;} +html[data-theme=dark] body::-webkit-scrollbar-thumb, html[data-theme="dark"] .MessagesBox::-webkit-scrollbar-thumb, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-thumb, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-thumb, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-thumb, .ChatListGroup-SectionContent::-webkit-scrollbar-thumb, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-thumb, html[data-theme=dark] .ChatBox textarea.Input::-webkit-scrollbar-thumb {background: #3f4752 !important;} html[data-theme=dark] body::-webkit-scrollbar-track {background: #22272e !important;} -html[data-theme=dark] .MessagesBox::-webkit-scrollbar-track, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-track, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-track, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-track, .ChatListGroup-SectionContent::-webkit-scrollbar-track, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-track {background: #2d333b !important;} +html[data-theme=dark] .MessagesBox::-webkit-scrollbar-track, html[data-theme="dark"] .Messages-list::-webkit-scrollbar-track, html[data-theme=dark] .PushNotifications-list::-webkit-scrollbar-track, html[data-theme=dark] .CommentListV2::-webkit-scrollbar-track, .ChatListGroup-SectionContent::-webkit-scrollbar-track, html[data-theme=dark] .ChatSideBar-Search-ResultListWrap::-webkit-scrollbar-track, html[data-theme=dark] .ChatBox textarea.Input::-webkit-scrollbar-track {background: #2d333b !important;} html {scrollbar-width: thin; scrollbar-color: #3f4752 #22272e;} .MessagesBox, .Messages-list, .PushNotifications-list, .CommentListV2, .ChatListGroup-SectionContent, .ChatSideBar-Search-ResultListWrap {scrollbar-width: thin; scrollbar-color: #3f4752 #2D333B;} From 1e863df74a32fdf86cf5015395f65ccdf4a1cce1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 16 May 2021 10:07:14 +0800 Subject: [PATCH 0241/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E9=A1=B6=E9=83=A8=EF=BC=88=E5=8F=B3=E9=94=AE=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=B8=A4=E4=BE=A7=E7=A9=BA=E7=99=BD=E5=A4=84=EF=BC=89?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index fe598b2b3..1032e3046 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.7 +// @version 1.0.8 // @author X.I.U -// @description 自动无缝翻页、自动显示帖子内隐藏回复 +// @description 自动无缝翻页、自动显示帖子内隐藏回复、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -20,7 +20,8 @@ (function() { var menu_ALL = [ ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], - ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true] + ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true], + ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true] ], menu_ID = []; for (let i=0;i Date: Sun, 16 May 2021 10:11:46 +0800 Subject: [PATCH 0242/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 08f87b94a..140d4a45e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页**、屏蔽导读悬赏贴(最新发表页) | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示隐藏回复(帖子内) | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、回到顶部(右键空白处)、自动显示隐藏回复... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ From 896a16c6ba287ee8f764853d3fee980059ae892b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 16 May 2021 10:54:35 +0800 Subject: [PATCH 0243/2377] README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 140d4a45e..965b461df 100644 --- a/README.md +++ b/README.md @@ -17,21 +17,21 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| [](https://github.com/XIU2) | **护眼模式** | 最简单的全网通用护眼模式、夜间模式、暗黑模式 | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | -| [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高度... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内容... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| [](https://github.com/XIU2) | **护眼模式** | 最简单的全网通用护眼模式、夜间模式、暗黑模式 | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | +| [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | +| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、链接转图片、自动无缝翻页、新标签页打开链接... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone/SSH、Release、Raw、Code(ZIP) 文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | -| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 423Down、Apphot、不死鸟、小众软件、异次元软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | +| [](https://github.com/XIU2) | **自动无缝翻页 \*** | 423Down、Apphot、不死鸟、小众软件、异次元软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/413593)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** | | [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子、自动滚动至隐藏... | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、样式优化、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 增强** | 自动签到、**自动回复**、自动无缝翻页、快捷回到顶部、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显示... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页**、屏蔽导读悬赏贴(最新发表页) | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、回到顶部(右键空白处)、自动显示隐藏回复... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示隐藏回复(帖子内) | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ From 10c1be4018e6cb77d062e15b8436b61cf7062adb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 17 May 2021 15:30:01 +0800 Subject: [PATCH 0244/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=B1=8F=E8=94=BD=E9=98=85=E8=AF=BB=E6=9D=83=E9=99=90?= =?UTF-8?q?=20255=20=E7=9A=84=E5=B8=96=E5=AD=90]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 1032e3046..158d22b6b 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.8 +// @version 1.0.9 // @author X.I.U -// @description 自动无缝翻页、自动显示帖子内隐藏回复、回到顶部(右键点击两侧空白处) +// @description 自动无缝翻页、自动显示帖子内隐藏回复、自动屏蔽阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -21,6 +21,7 @@ var menu_ALL = [ ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true], + ['menu_delate255', '自动屏蔽阅读权限 255 的帖子', '自动屏蔽阅读权限 255 的帖子', true], ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true] ], menu_ID = []; for (let i=0;i -1){ // 各板块帖子列表 curSite = DBSite.forum; + if (menu_value('menu_delate255')) delate255(); // 屏蔽阅读权限 255 的帖子 }else if (patt_guide.test(location.search)){ // 导读帖子列表 curSite = DBSite.guide; @@ -143,12 +145,19 @@ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; - let scrollDelta = 766; - if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + scrollDelta) { + if (document.documentElement.scrollHeight <= document.documentElement.clientHeight + scrollTop + 999) { if (curSite.SiteTypeID === SiteType.FORUM) { // 如果是各版块帖子列表则直接点下一页就行了 let autopbn = document.querySelector('#autopbn'); - if (autopbn && autopbn.innerText == "下一页 »"){ // 如果已经在加载中了,就忽略 + if (autopbn && autopbn.innerText === "下一页 »"){ // 如果已经在加载中了,就忽略 autopbn.click(); + if (menu_value('menu_delate255')) { + let timer = setInterval(function(){ + if (document.querySelector('#autopbn').innerText === "下一页 »") { + delate255(); + clearInterval(timer); + } + }, 10); + } } }else{ ShowPager.loadMorePage(); @@ -190,6 +199,19 @@ } + // 屏蔽阅读权限 255 的帖子 + function delate255() { + if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ + let tbody = document.querySelectorAll('tbody[id^="normalthread_"] .common .xw1'); + Array.from(tbody).forEach(function (_this) { + if (_this.innerText === '255') { + _this.parentNode.parentNode.parentNode.remove(); + } + }) + } + } + + // 滚动条事件 function windowScroll(fn1) { var beforeScrollTop = document.documentElement.scrollTop, From d9a9548a24b7f6d498365c9a7ec98f8124fed1ce Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 17 May 2021 15:33:51 +0800 Subject: [PATCH 0245/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=9A=90=E8=97=8F=E9=98=85=E8=AF=BB=E6=9D=83=E9=99=90?= =?UTF-8?q?=20255=20=E7=9A=84=E5=B8=96=E5=AD=90]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 158d22b6b..dd3f51683 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 全球主机交流论坛增强 // @version 1.0.9 // @author X.I.U -// @description 自动无缝翻页、自动显示帖子内隐藏回复、自动屏蔽阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) +// @description 自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -21,7 +21,7 @@ var menu_ALL = [ ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true], - ['menu_delate255', '自动屏蔽阅读权限 255 的帖子', '自动屏蔽阅读权限 255 的帖子', true], + ['menu_delate255', '自动隐藏阅读权限 255 的帖子', '自动隐藏阅读权限 255 的帖子', true], ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true] ], menu_ID = []; for (let i=0;i -1){ // 各板块帖子列表 curSite = DBSite.forum; - if (menu_value('menu_delate255')) delate255(); // 屏蔽阅读权限 255 的帖子 + if (menu_value('menu_delate255')) delate255(); // 自动隐藏阅读权限 255 的帖子 }else if (patt_guide.test(location.search)){ // 导读帖子列表 curSite = DBSite.guide; @@ -150,7 +150,7 @@ let autopbn = document.querySelector('#autopbn'); if (autopbn && autopbn.innerText === "下一页 »"){ // 如果已经在加载中了,就忽略 autopbn.click(); - if (menu_value('menu_delate255')) { + if (menu_value('menu_delate255')) { // 自动隐藏阅读权限 255 的帖子 let timer = setInterval(function(){ if (document.querySelector('#autopbn').innerText === "下一页 »") { delate255(); @@ -199,7 +199,7 @@ } - // 屏蔽阅读权限 255 的帖子 + // 自动隐藏阅读权限 255 的帖子 function delate255() { if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ let tbody = document.querySelectorAll('tbody[id^="normalthread_"] .common .xw1'); From e6d20a5bcee01fb7f644c6ae6a95b97f6443515d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 19 May 2021 20:26:04 +0800 Subject: [PATCH 0246/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=83=85=E5=86=B5=E4=B8=8B=E4=BC=9A=E6=8A=8A?= =?UTF-8?q?=20Git=20Clone=20SSH=20=E5=8A=A0=E9=80=9F=E6=BA=90=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=B0=20GitHub=20CLI=20=E5=88=97=E8=A1=A8=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 0d6ce4cf5..198f22b71 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.4.9 +// @version 1.5.0 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -223,6 +223,8 @@ url = [], _html = ``; + if (href_split[0] != 'git@github.com') return + for (let i=0;i Date: Fri, 21 May 2021 15:04:52 +0800 Subject: [PATCH 0247/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E7=BE=8E?= =?UTF-8?q?=E5=9B=BD=E8=B4=B9=E5=88=A9=E8=92=99]=20=E5=8A=A0=E9=80=9F?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 198f22b71..66686ff99 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.5.0 +// @version 1.5.1 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -34,6 +34,7 @@ ['https://gh.api.99988866.xyz','美国'], ['https://gh.msx.workers.dev','美国'], ['https://gh.xiu2.xyz','美国'], + ['https://gh.argv.cc','美国费利蒙'], ['https://git.yumenaka.net','美国洛杉矶'], ['https://download.fastgit.org','日本东京'], ['https://ghproxy.com','韩国首尔'], From b373c1daa6f40fd203d95caadac47416e466ef6d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 22 May 2021 09:49:51 +0800 Subject: [PATCH 0248/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0]=20=E5=8A=9F=E8=83=BD=EF=BC=88?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=BF=E9=97=AE=E7=A9=BA=E9=97=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 56 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index dd3f51683..49db8a120 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.0.9 +// @version 1.1.0 // @author X.I.U -// @description 自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) +// @description 自动签到(访问空间)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -19,6 +19,8 @@ (function() { var menu_ALL = [ + ['menu_autoSignIn', '自动签到', '自动签到', true], + ['menu_reAutoSignIn', '重新签到', '重新签到', ''], ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true], ['menu_delate255', '自动隐藏阅读权限 255 的帖子', '自动隐藏阅读权限 255 的帖子', true], @@ -38,7 +40,11 @@ } for (let i=0;i Date: Sat, 22 May 2021 09:53:18 +0800 Subject: [PATCH 0249/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index a78a50e84..e05f907e2 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -397,7 +397,7 @@ // 输入密码后回车确认 function enterToPass() { document.getElementById('pwd').onkeydown = function(e){ - if(e.keyCode == 13){ + if(e.key === 'Enter'){ document.getElementById('sub').click(); } }; From 9c79b03b6f8d0259d9f9d0a4be46bb24c315fa6f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 22 May 2021 10:02:15 +0800 Subject: [PATCH 0250/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index e05f907e2..c95f5d8ab 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -153,9 +153,7 @@ function refreshCorrection() { document.onkeydown = mainframe.onkeydown = function (e) { e = window.event || e; - let keycode = e.keyCode; - if (keycode == 116) { - e.keyCode = 0; + if (e.key === 'F5') { let folderID = /-?\d+/.exec(mainframe.document.getElementById("filemore").children[0].getAttribute("onclick")) if(folderID.length > 0){ mainframe.folder(folderID[0]); @@ -172,8 +170,7 @@ function UNrefreshCorrection() { document.onkeydown = mainframe.onkeydown = function (e) { e = window.event || e; - let keycode = e.keyCode; - if (keycode == 116) { + if (e.key === 'F5') { return true; } } From ac5c51cd21682867ffbcc4dedea4bf473a31e047 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 22 May 2021 13:59:43 +0800 Subject: [PATCH 0251/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 965b461df..9264e69d5 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页**、屏蔽导读悬赏贴(最新发表页) | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | 自动无缝翻页、自动显示隐藏回复(帖子内) | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动签到(访问空间)**、自动无缝翻页、自动显示隐藏回复... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ From 4085ef774fe9350e6c91992a5cb8699bb43402a5 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 22 May 2021 14:03:21 +0800 Subject: [PATCH 0252/2377] README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9264e69d5..7970354be 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ | [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | -| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | 自动签到、**自动无缝翻页**、屏蔽导读悬赏贴(最新发表页) | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动签到(访问空间)**、自动无缝翻页、自动显示隐藏回复... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | **自动签到**、自动无缝翻页、屏蔽导读悬赏贴 (最新发表页)... | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动签到 (访问空间)**、自动无缝翻页、自动显示隐藏回复... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ From e867879928d25bbc4c0d5b14005c3dad488e2283 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 23 May 2021 00:17:45 +0800 Subject: [PATCH 0253/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=96=87?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 49db8a120..4dca19872 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -152,7 +152,7 @@ let timeNow = new Date().getFullYear() + "/" + (new Date().getMonth() + 1) + "/" + new Date().getDate(), timeOld = GM_getValue('menu_signInTime'); if (!timeOld || timeOld != timeNow) { // 是新的一天 - GM_notification({text: '请不要关闭/刷新网页!耐心等待 60 秒~\n在此期间可以在 "其他标签页" 浏览论坛!', timeout: 10000}); + GM_notification({text: '请不要关闭/刷新本页!耐心等待 60 秒~\n在此期间可以在 "其他标签页" 浏览论坛!', timeout: 10000}); let url_list = [], url = 0; // 随机生成 12 个空间地址(2 个冗余) From 450a78087b05cbe91c15a7c22b08d1051c41d465 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 23 May 2021 00:20:28 +0800 Subject: [PATCH 0254/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0]=20=E5=8A=9F=E8=83=BD=EF=BC=88?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E5=AE=8C=E6=88=90=E5=90=8E=E5=B0=86=E4=BC=9A?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 4dca19872..1f79ade7c 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.0 +// @version 1.1.1 // @author X.I.U // @description 自动签到(访问空间)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* @@ -168,6 +168,7 @@ console.log(`[全球主机交流论坛 增强] 金钱 +2 (${url_list[url]})`); if (url === 11) { // 次数够了就取消定时循环 console.log('[全球主机交流论坛 增强] 签到完成!'); + GM_notification({text: '签到完成!金钱 +20 ~', timeout: 3500}); GM_setValue('menu_signingIn', false); GM_setValue('menu_signInTime', timeNow); // 写入签到时间以供后续比较 clearInterval(signIn); From 5a8f7b8e455fcbf73c13c6230ddfb03756666768 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 23 May 2021 15:56:24 +0800 Subject: [PATCH 0255/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7=EF=BC=88=E9=BB=91?= =?UTF-8?q?=E5=90=8D=E5=8D=95=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 56 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 1f79ade7c..7d715b155 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.1 +// @version 1.1.2 // @author X.I.U -// @description 自动签到(访问空间)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) +// @description 自动签到(访问空间)、屏蔽指定用户(黑名单)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -21,6 +21,8 @@ var menu_ALL = [ ['menu_autoSignIn', '自动签到', '自动签到', true], ['menu_reAutoSignIn', '重新签到', '重新签到', ''], + ['menu_blockUsers', '屏蔽指定用户', '屏蔽指定用户', false], + ['menu_customBlockUsers', '自定义屏蔽用户', '自定义屏蔽用户', []], ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true], ['menu_delate255', '自动隐藏阅读权限 255 的帖子', '自动隐藏阅读权限 255 的帖子', true], @@ -42,6 +44,8 @@ menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); if (menu_ALL[i][0] === 'menu_reAutoSignIn') { menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){reAutoSignIn()}); + } else if (menu_ALL[i][0] === 'menu_customBlockUsers') { + menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){customBlockUsers()}); } else { menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } @@ -128,16 +132,19 @@ hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 } showPosts(); // 自动显示帖子内被隐藏的回复 + blockUsers('thread'); }else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ // 各板块帖子列表 curSite = DBSite.forum; if (menu_value('menu_delate255')) delate255(); // 自动隐藏阅读权限 255 的帖子 + blockUsers('forum'); }else if (patt_guide.test(location.search)){ // 导读帖子列表 curSite = DBSite.guide; }else if(location.pathname === '/search.php'){ // 搜索结果列表 curSite = DBSite.search; + blockUsers('search'); } curSite.pageUrl = ""; // 下一页URL @@ -188,6 +195,51 @@ } + // 自定义屏蔽用户 + function customBlockUsers() { + let nowBlockUsers = ''; + menu_value('menu_customBlockUsers').forEach(function(item){nowBlockUsers = nowBlockUsers + '|' + item}) + let newBlockUsers = prompt('编辑 [自定义屏蔽用户],刷新网页后生效\n(不同用户名之间使用 "|" 分隔,\n(例如:用户A|用户B|用户C,如果只有一个就不需要 "|" 了。', nowBlockUsers.replace('|','')); + if (newBlockUsers === '') { + GM_setValue('menu_customBlockUsers', []); + } else if (newBlockUsers != null) { + GM_setValue('menu_customBlockUsers', newBlockUsers.split('|')); + } + }; + + + // 屏蔽指定用户 + function blockUsers(type) { + if (!menu_value('menu_blockUsers')) return + if (!menu_value('menu_customBlockUsers') || menu_value('menu_customBlockUsers').length < 1) return + switch(type) { + case 'thread': + blockUsers_('[id^="post_"]'); + break; + case 'forum': + blockUsers_('[id^="normalthread_"]'); + break; + case 'search': + blockUsers_('.pbw'); + break; + } + + function blockUsers_(list) { + let listItem = document.querySelectorAll(list); + if (listItem.length < 1) return + listItem.forEach(function(item){ // 遍历所有帖子 + menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 + let itemName = item.querySelector('a[href^="space-uid"]'); // 寻找用户名 + if (itemName && itemName.innerText === item1) { + //console.log(item1); + item.remove(); // 删除帖子 + } + }) + }) + } + } + + // 自动翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ From c5a043634e180b824945e8df810d371282fd86eb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 23 May 2021 15:57:54 +0800 Subject: [PATCH 0256/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88=E9=81=BF=E5=85=8D=E6=B8=85=E7=A9=BA=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=BB=91=E5=90=8D=E5=8D=95=E5=90=8E=E5=87=BA=E9=94=99?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 0854001c8..60c616bc2 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.4.1 +// @version 1.4.2 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -213,7 +213,10 @@ function customBlockUsers() { let nowBlockUsers = ''; menu_value('menu_customBlockUsers').forEach(function(item){nowBlockUsers = nowBlockUsers + '|' + item}) let newBlockUsers = prompt('编辑 [自定义屏蔽用户]\n(不同用户名之间使用 "|" 分隔,例如:用户A|用户B|用户C )', nowBlockUsers.replace('|','')); - if (newBlockUsers != null) { + if (newBlockUsers === '') { + GM_setValue('menu_customBlockUsers', []); + registerMenuCommand(); // 重新注册脚本菜单 + } else if (newBlockUsers != null) { GM_setValue('menu_customBlockUsers', newBlockUsers.split('|')); registerMenuCommand(); // 重新注册脚本菜单 } @@ -223,6 +226,7 @@ function customBlockUsers() { // 屏蔽指定用户 function blockUsers(type) { if (!menu_value('menu_blockUsers')) return + if (!menu_value('menu_customBlockUsers') || menu_value('menu_customBlockUsers').length < 1) return switch(type) { case 'index': blockUsers_index(); From eba0e2f3ab2ff4727b8194d362522a797b0f04c7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 23 May 2021 16:11:25 +0800 Subject: [PATCH 0257/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7=EF=BC=88=E9=BB=91?= =?UTF-8?q?=E5=90=8D=E5=8D=95=EF=BC=89]=20=E5=8A=9F=E8=83=BD=EF=BC=88?= =?UTF-8?q?=E9=80=82=E9=85=8D=E8=87=AA=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB?= =?UTF-8?q?=E9=A1=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 7d715b155..4f5faa8ed 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.2 +// @version 1.1.3 // @author X.I.U // @description 自动签到(访问空间)、屏蔽指定用户(黑名单)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* @@ -231,7 +231,7 @@ menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 let itemName = item.querySelector('a[href^="space-uid"]'); // 寻找用户名 if (itemName && itemName.innerText === item1) { - //console.log(item1); + console.log(item1); item.remove(); // 删除帖子 } }) @@ -255,6 +255,7 @@ let timer = setInterval(function(){ if (document.querySelector('#autopbn').innerText === "下一页 »") { delate255(); + blockUsers('forum'); clearInterval(timer); } }, 10); @@ -392,6 +393,13 @@ pageElems.forEach(function (one) { toElement.insertAdjacentElement(addTo, one); }); + if (menu_value('menu_blockUsers')) { // 屏蔽指定用户 + if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1) { + blockUsers('thread'); + } else if (location.pathname === '/search.php') { + blockUsers('search'); + } + } // 替换待替换元素 try { let oriE = getAllElements(curSite.pager.replaceE); From 4ba9f6b091dc79c1b586add865fd174f08835502 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 23 May 2021 16:54:53 +0800 Subject: [PATCH 0258/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7=EF=BC=88=E9=BB=91?= =?UTF-8?q?=E5=90=8D=E5=8D=95=EF=BC=89]=20=E5=8A=9F=E8=83=BD=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=B6=88=E6=81=AF=E3=80=81=E7=82=B9=E8=AF=84=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 49 ++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 4f5faa8ed..c620ac0cc 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.3 +// @version 1.1.4 // @author X.I.U // @description 自动签到(访问空间)、屏蔽指定用户(黑名单)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* @@ -125,26 +125,26 @@ patt_guide = /mod\=guide\&view\=(hot|digest)/ // URL 判断 - if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1){ - // 帖子内 - if(menu_value('menu_thread_pageLoading')) { + if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1) { // 帖子内 + if (menu_value('menu_thread_pageLoading')) { curSite = DBSite.thread; hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 } showPosts(); // 自动显示帖子内被隐藏的回复 blockUsers('thread'); - }else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ - // 各板块帖子列表 + } else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1) { // 各板块帖子列表 curSite = DBSite.forum; if (menu_value('menu_delate255')) delate255(); // 自动隐藏阅读权限 255 的帖子 blockUsers('forum'); - }else if (patt_guide.test(location.search)){ - // 导读帖子列表 + }else if (patt_guide.test(location.search)) { // 导读帖子列表 curSite = DBSite.guide; - }else if(location.pathname === '/search.php'){ - // 搜索结果列表 + } else if(location.pathname === '/search.php') { // 搜索结果列表 curSite = DBSite.search; blockUsers('search'); + } else if(location.pathname === '/home.php' && location.search.indexOf('mod=space&do=notice&view=mypost') > -1) { // 消息(帖子/点评/提到) + blockUsers('notice'); + } else if(location.pathname === '/home.php' && location.search === '?mod=space&do=pm') { // 消息(私人聊天) + blockUsers('pm'); } curSite.pageUrl = ""; // 下一页URL @@ -198,12 +198,14 @@ // 自定义屏蔽用户 function customBlockUsers() { let nowBlockUsers = ''; - menu_value('menu_customBlockUsers').forEach(function(item){nowBlockUsers = nowBlockUsers + '|' + item}) + GM_getValue('menu_customBlockUsers').forEach(function(item){nowBlockUsers = nowBlockUsers + '|' + item}) let newBlockUsers = prompt('编辑 [自定义屏蔽用户],刷新网页后生效\n(不同用户名之间使用 "|" 分隔,\n(例如:用户A|用户B|用户C,如果只有一个就不需要 "|" 了。', nowBlockUsers.replace('|','')); if (newBlockUsers === '') { GM_setValue('menu_customBlockUsers', []); + registerMenuCommand(); // 重新注册脚本菜单 } else if (newBlockUsers != null) { GM_setValue('menu_customBlockUsers', newBlockUsers.split('|')); + registerMenuCommand(); // 重新注册脚本菜单 } }; @@ -213,23 +215,30 @@ if (!menu_value('menu_blockUsers')) return if (!menu_value('menu_customBlockUsers') || menu_value('menu_customBlockUsers').length < 1) return switch(type) { - case 'thread': - blockUsers_('[id^="post_"]'); + case 'thread': // 帖子内 + blockUsers_('[id^="post_"]', 'a[href^="space-uid"]'); + blockUsers_('[id^="comment_"] > div', 'a.xi2.xw1'); // 点评 break; - case 'forum': - blockUsers_('[id^="normalthread_"]'); + case 'forum': // 各版块帖子列表 + blockUsers_('[id^="normalthread_"]', 'a[href^="space-uid"]'); break; - case 'search': - blockUsers_('.pbw'); + case 'search': // 搜索结果 + blockUsers_('.pbw', 'a[href^="space-uid"]'); + break; + case 'notice': // 消息 + blockUsers_('dl.cl', '.ntc_body a[href^="space-uid"]'); + break; + case 'pm': // 私人聊天 + blockUsers_('dl[id^="pmlist_"]', '.ptm.pm_c a[href^="space-uid"]'); break; } - function blockUsers_(list) { - let listItem = document.querySelectorAll(list); + function blockUsers_(list1, list2) { + let listItem = document.querySelectorAll(list1); if (listItem.length < 1) return listItem.forEach(function(item){ // 遍历所有帖子 menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 - let itemName = item.querySelector('a[href^="space-uid"]'); // 寻找用户名 + let itemName = item.querySelector(list2); // 寻找用户名 if (itemName && itemName.innerText === item1) { console.log(item1); item.remove(); // 删除帖子 From e0cf124a292ce57ee4747a8f1f37ea087fd48328 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 23 May 2021 17:01:07 +0800 Subject: [PATCH 0259/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7970354be..ab5e4c69b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | **自动签到**、自动无缝翻页、屏蔽导读悬赏贴 (最新发表页)... | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动签到 (访问空间)**、自动无缝翻页、自动显示隐藏回复... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动签到 (访问空间)、屏蔽指定用户**、自动无缝翻页等... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ From 0c75bf0d8d2f4349c7e221d6861af24939075537 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 23 May 2021 17:19:21 +0800 Subject: [PATCH 0260/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0(=E8=AE=BF=E9=97=AE=E7=A9=BA?= =?UTF-8?q?=E9=97=B4)]=20=E5=8A=9F=E8=83=BD=EF=BC=88=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=B0=86=E4=B8=8D=E4=BC=9A=E8=BF=90=E8=A1=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index c620ac0cc..fc5db8850 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.4 +// @version 1.1.5 // @author X.I.U // @description 自动签到(访问空间)、屏蔽指定用户(黑名单)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* @@ -74,6 +74,12 @@ } } + // 检查是否登陆 + var loginStatus = false; + if (document.getElementById('um')){ + loginStatus = true; + } + // 默认 ID 为 0 var curSite = {SiteTypeID: 0}; @@ -155,6 +161,7 @@ // 自动签到(访问空间 10 次 = 20 积分) function autoSignIn() { + if (!loginStatus) return if (GM_getValue('menu_signingIn')) return let timeNow = new Date().getFullYear() + "/" + (new Date().getMonth() + 1) + "/" + new Date().getDate(), timeOld = GM_getValue('menu_signInTime'); From 62478063430dcd954b531d5a747d1e68314114bd Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 24 May 2021 09:35:25 +0800 Subject: [PATCH 0261/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E5=85=B3=E9=94=AE=E8=AF=8D=EF=BC=88=E5=B8=96=E5=AD=90?= =?UTF-8?q?=E6=A0=87=E9=A2=98=EF=BC=89]=20=E5=8A=9F=E8=83=BD;=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20[=E5=B1=8F=E8=94=BD=E7=94=A8=E6=88=B7=E3=80=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=9A=90=E8=97=8F=E9=98=85=E8=AF=BB=E6=9D=83?= =?UTF-8?q?=E9=99=90=20255=20=E7=9A=84=E5=B8=96=E5=AD=90]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 93 +++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 24 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index fc5db8850..d0f2b31b9 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.5 +// @version 1.1.6 // @author X.I.U -// @description 自动签到(访问空间)、屏蔽指定用户(黑名单)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) +// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -21,8 +21,10 @@ var menu_ALL = [ ['menu_autoSignIn', '自动签到', '自动签到', true], ['menu_reAutoSignIn', '重新签到', '重新签到', ''], - ['menu_blockUsers', '屏蔽指定用户', '屏蔽指定用户', false], + ['menu_blockUsers', '屏蔽用户', '屏蔽用户', false], ['menu_customBlockUsers', '自定义屏蔽用户', '自定义屏蔽用户', []], + ['menu_blockKeywords', '屏蔽关键词(帖子标题)', '屏蔽关键词(帖子标题)', false], + ['menu_customBlockKeywords', '自定义屏蔽关键词', '自定义屏蔽关键词', []], ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true], ['menu_delate255', '自动隐藏阅读权限 255 的帖子', '自动隐藏阅读权限 255 的帖子', true], @@ -46,6 +48,8 @@ menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){reAutoSignIn()}); } else if (menu_ALL[i][0] === 'menu_customBlockUsers') { menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){customBlockUsers()}); + } else if (menu_ALL[i][0] === 'menu_customBlockKeywords') { + menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){customBlockKeywords()}); } else { menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } @@ -134,23 +138,27 @@ if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1) { // 帖子内 if (menu_value('menu_thread_pageLoading')) { curSite = DBSite.thread; - hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 } - showPosts(); // 自动显示帖子内被隐藏的回复 - blockUsers('thread'); + showPosts(); // 自动显示帖子内被隐藏的回复 + blockUsers('thread'); // 屏蔽用户(黑名单) } else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1) { // 各板块帖子列表 curSite = DBSite.forum; - if (menu_value('menu_delate255')) delate255(); // 自动隐藏阅读权限 255 的帖子 - blockUsers('forum'); - }else if (patt_guide.test(location.search)) { // 导读帖子列表 + if (menu_value('menu_delate255')) { // 自动隐藏阅读权限 255 的帖子 + delate255(); + setTimeout(delate255, 1500); // 为了避免有时候网页加载太慢时没有隐藏成功的问题 + } + blockUsers('forum'); // 屏蔽用户(黑名单) + blockKeywords(); // 屏蔽关键词(帖子标题) + }else if (patt_guide.test(location.search)) { // 导读帖子列表 curSite = DBSite.guide; - } else if(location.pathname === '/search.php') { // 搜索结果列表 + } else if(location.pathname === '/search.php') { // 搜索结果列表 curSite = DBSite.search; - blockUsers('search'); + blockUsers('search'); // 屏蔽用户(黑名单) } else if(location.pathname === '/home.php' && location.search.indexOf('mod=space&do=notice&view=mypost') > -1) { // 消息(帖子/点评/提到) - blockUsers('notice'); + blockUsers('notice'); // 屏蔽用户(黑名单) } else if(location.pathname === '/home.php' && location.search === '?mod=space&do=pm') { // 消息(私人聊天) - blockUsers('pm'); + blockUsers('pm'); // 屏蔽用户(黑名单) } curSite.pageUrl = ""; // 下一页URL @@ -217,7 +225,7 @@ }; - // 屏蔽指定用户 + // 屏蔽用户 function blockUsers(type) { if (!menu_value('menu_blockUsers')) return if (!menu_value('menu_customBlockUsers') || menu_value('menu_customBlockUsers').length < 1) return @@ -256,6 +264,44 @@ } + // 自定义屏蔽关键词(帖子标题) + function customBlockKeywords() { + let nowBlockKeywords = ''; + GM_getValue('menu_customBlockKeywords').forEach(function(item){nowBlockKeywords = nowBlockKeywords + '|' + item}) + let newBlockKeywords = prompt('编辑 [自定义屏蔽关键词],刷新网页后生效\n(不同关键词之间使用 "|" 分隔,\n(例如:嘿嘿|呵呵|嘎嘎,如果只有一个就不需要 "|" 了。', nowBlockKeywords.replace('|','')); + if (newBlockKeywords === '') { + GM_setValue('menu_customBlockKeywords', []); + registerMenuCommand(); // 重新注册脚本菜单 + } else if (newBlockKeywords != null) { + GM_setValue('menu_customBlockKeywords', newBlockKeywords.split('|')); + registerMenuCommand(); // 重新注册脚本菜单 + } + }; + + + // 屏蔽关键词(帖子标题) + function blockKeywords() { + if (!menu_value('menu_blockKeywords')) return + if (!menu_value('menu_customBlockKeywords') || menu_value('menu_customBlockKeywords').length < 1) return + //console.log('1111'); + let listItem = document.querySelectorAll('[id^="normalthread_"]'); + //console.log(listItem); + if (listItem.length < 1) return + listItem.forEach(function(item){ // 遍历所有帖子标题 + //console.log(item); + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词 + let itemName = item.querySelector('th a.s.xst'); // 寻找帖子标题 + //console.log(itemName); + //console.log(item1, itemName.innerText); + if (itemName && itemName.innerText.indexOf(item1) > -1) { + console.log(item1, itemName.innerText); + item.remove(); // 删除帖子 + } + }) + }) + } + + // 自动翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ @@ -267,15 +313,14 @@ let autopbn = document.querySelector('#autopbn'); if (autopbn && autopbn.innerText === "下一页 »"){ // 如果已经在加载中了,就忽略 autopbn.click(); - if (menu_value('menu_delate255')) { // 自动隐藏阅读权限 255 的帖子 - let timer = setInterval(function(){ - if (document.querySelector('#autopbn').innerText === "下一页 »") { - delate255(); - blockUsers('forum'); - clearInterval(timer); - } - }, 10); - } + let timer = setInterval(function(){ // 在下一页加载完成后 + if (document.querySelector('#autopbn').innerText === "下一页 »") { + if (menu_value('menu_delate255')) delate255(); // 隐藏 255 权限帖子 + if (menu_value('menu_blockUsers')) blockUsers('forum'); // 屏蔽用户(黑名单) + if (menu_value('menu_blockKeywords')) blockKeywords(); // 屏蔽关键词(帖子标题) + clearInterval(timer); + } + }, 10); } }else{ ShowPager.loadMorePage(); @@ -409,7 +454,7 @@ pageElems.forEach(function (one) { toElement.insertAdjacentElement(addTo, one); }); - if (menu_value('menu_blockUsers')) { // 屏蔽指定用户 + if (menu_value('menu_blockUsers')) { // 屏蔽用户(黑名单) if (patt_thread.test(location.pathname) || location.search.indexOf('mod=viewthread') > -1) { blockUsers('thread'); } else if (location.pathname === '/search.php') { From ad409bb24073c9225751ffa2317287ce3b5aa7d1 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 24 May 2021 13:35:00 +0800 Subject: [PATCH 0262/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index 45f4c8e5a..d0a691178 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -222,6 +222,7 @@ } else if (document.getElementById('gift_v2excellent')) { // 兼容 [V2ex Plus] 扩展 document.getElementById('gift_v2excellent').click(); GM_setValue('menu_clockInTime', timeNow); // 写入签到时间以供后续比较 + console.info('[V2EX 增强] 自动签到完成!') } else { // 都没有找到,说明已经签过到了 console.info('[V2EX 增强] 已经签过到了。') } @@ -345,7 +346,7 @@ function linksBlank(css) { if (!menu_value('menu_linksBlank')) return let links = document.querySelectorAll(css);if (!links) return - Array.from(links).forEach(function (_this) { + links.forEach(function (_this) { _this.target = '_blank' }); } From ccef91b9f8c72b0144bbee0c442c721fb6e3dc17 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 24 May 2021 13:59:36 +0800 Subject: [PATCH 0263/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index d0f2b31b9..3da2f044b 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -196,9 +196,9 @@ clearInterval(signIn); } }, 5000); - } else { // 新旧签到时间一致 + }/* else { // 新旧签到时间一致 console.info('[全球主机交流论坛 增强] 已经签过到了。') - } + }*/ } @@ -255,7 +255,7 @@ menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 let itemName = item.querySelector(list2); // 寻找用户名 if (itemName && itemName.innerText === item1) { - console.log(item1); + console.log(`屏蔽用户:${item1}`); item.remove(); // 删除帖子 } }) @@ -283,18 +283,13 @@ function blockKeywords() { if (!menu_value('menu_blockKeywords')) return if (!menu_value('menu_customBlockKeywords') || menu_value('menu_customBlockKeywords').length < 1) return - //console.log('1111'); let listItem = document.querySelectorAll('[id^="normalthread_"]'); - //console.log(listItem); if (listItem.length < 1) return listItem.forEach(function(item){ // 遍历所有帖子标题 - //console.log(item); menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词 let itemName = item.querySelector('th a.s.xst'); // 寻找帖子标题 - //console.log(itemName); - //console.log(item1, itemName.innerText); if (itemName && itemName.innerText.indexOf(item1) > -1) { - console.log(item1, itemName.innerText); + console.log(`屏蔽关键词:[${item1}]`, `,帖子标题:[${itemName.innerText}]`); item.remove(); // 删除帖子 } }) From d6043b10ee72b1480cbc885ab792979bde785ed6 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 24 May 2021 14:04:17 +0800 Subject: [PATCH 0264/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 3da2f044b..e1bc0a8c1 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -268,7 +268,7 @@ function customBlockKeywords() { let nowBlockKeywords = ''; GM_getValue('menu_customBlockKeywords').forEach(function(item){nowBlockKeywords = nowBlockKeywords + '|' + item}) - let newBlockKeywords = prompt('编辑 [自定义屏蔽关键词],刷新网页后生效\n(不同关键词之间使用 "|" 分隔,\n(例如:嘿嘿|呵呵|嘎嘎,如果只有一个就不需要 "|" 了。', nowBlockKeywords.replace('|','')); + let newBlockKeywords = prompt('编辑 [自定义屏蔽关键词],刷新网页后生效\n(不同关键词之间使用 "|" 分隔,\n(例如:助力|互助|互点,如果只有一个就不需要 "|" 了。', nowBlockKeywords.replace('|','')); if (newBlockKeywords === '') { GM_setValue('menu_customBlockKeywords', []); registerMenuCommand(); // 重新注册脚本菜单 From c4b6f4f94f2eab08087cdab0b57a7e705e2dcf15 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 25 May 2021 11:17:41 +0800 Subject: [PATCH 0265/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E7=94=A8=E6=88=B7=E3=80=81=E5=B1=8F=E8=94=BD=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D]=20=E6=94=AF=E6=8C=81=20[=E6=9C=89=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E5=9B=9E=E5=A4=8D=E4=B8=BB=E9=A2=98=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=9F=A5=E7=9C=8B]=20=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index e1bc0a8c1..03c14eb70 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.6 +// @version 1.1.7 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) // @match *://hostloc.com/* @@ -146,10 +146,11 @@ curSite = DBSite.forum; if (menu_value('menu_delate255')) { // 自动隐藏阅读权限 255 的帖子 delate255(); - setTimeout(delate255, 1500); // 为了避免有时候网页加载太慢时没有隐藏成功的问题 + setTimeout(delate255, 2000); // 为了避免有时候网页加载太慢时没有隐藏成功的问题 } blockUsers('forum'); // 屏蔽用户(黑名单) blockKeywords(); // 屏蔽关键词(帖子标题) + if (patt_forum.test(location.pathname)) blockDOMNodeInserted(); // 监听插入事件(针对的是:有新的回复主题,点击查看) }else if (patt_guide.test(location.search)) { // 导读帖子列表 curSite = DBSite.guide; } else if(location.pathname === '/search.php') { // 搜索结果列表 @@ -287,7 +288,7 @@ if (listItem.length < 1) return listItem.forEach(function(item){ // 遍历所有帖子标题 menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词 - let itemName = item.querySelector('th a.s.xst'); // 寻找帖子标题 + let itemName = item.querySelector('a.s.xst'); // 寻找帖子标题 if (itemName && itemName.innerText.indexOf(item1) > -1) { console.log(`屏蔽关键词:[${item1}]`, `,帖子标题:[${itemName.innerText}]`); item.remove(); // 删除帖子 @@ -297,6 +298,20 @@ } + // 监听插入事件(针对的是:有新的回复主题,点击查看) + function blockDOMNodeInserted() { + let block = e => { + if (e.target.innerText && e.target.innerText.indexOf('newthread') > -1) { + setTimeout(function () { + blockUsers('forum'); // 屏蔽用户(黑名单) + blockKeywords(); // 屏蔽关键词(帖子标题) + }, 100) + } + } + document.addEventListener('DOMNodeInserted', block); // 监听插入事件 + } + + // 自动翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ From d5289733c38f2239e50b1dc2e5dc0fb4fc7d3d67 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 26 May 2021 19:38:02 +0800 Subject: [PATCH 0266/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E9=A2=84=E8=A7=88=E5=B8=96=E5=AD=90]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD;=20=E6=96=B0=E5=A2=9E=20[=E6=98=BE=E7=A4=BA=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=9C=A8=E7=BA=BF]=20=E5=8A=9F=E8=83=BD;=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20[=E5=B1=8F=E8=94=BD=E9=98=85=E8=AF=BB=E6=9D=83?= =?UTF-8?q?=E9=99=90=20255=20=E5=B8=96=E5=AD=90]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 66 ++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 03c14eb70..8c3d183df 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.7 +// @version 1.1.8 // @author X.I.U -// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、回到顶部(右键点击两侧空白处) +// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处) // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -26,9 +26,11 @@ ['menu_blockKeywords', '屏蔽关键词(帖子标题)', '屏蔽关键词(帖子标题)', false], ['menu_customBlockKeywords', '自定义屏蔽关键词', '自定义屏蔽关键词', []], ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], - ['menu_showhide', '自动显示隐藏回复', '自动显示隐藏回复', true], - ['menu_delate255', '自动隐藏阅读权限 255 的帖子', '自动隐藏阅读权限 255 的帖子', true], - ['menu_backToTop', '回到顶部(右键点击两侧空白处)', '回到顶部', true] + ['menu_showhide', '显示隐藏回复', '显示隐藏回复', true], + ['menu_backToTop', '快捷回到顶部(右键点击两侧空白处)', '快捷回到顶部', true], + ['menu_collapsedNowPost', '收起预览帖子(左键点击两侧空白处)', '收起预览帖子', true], + ['menu_onlineStatus', '显示是否在线', '显示是否在线', true], + ['menu_delate255', '屏蔽阅读权限 255 帖子', '屏蔽阅读权限 255 帖子', true] ], menu_ID = []; for (let i=0;i -1) { // 帖子内 if (menu_value('menu_thread_pageLoading')) { curSite = DBSite.thread; - hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 + hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮 } - showPosts(); // 自动显示帖子内被隐藏的回复 - blockUsers('thread'); // 屏蔽用户(黑名单) + showPosts(); // 自动显示帖子内被隐藏的回复 + blockUsers('thread'); // 屏蔽用户(黑名单) + if (menu_value('menu_onlineStatus')) onlineStatus(); // 显示是否在线 } else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1) { // 各板块帖子列表 curSite = DBSite.forum; - if (menu_value('menu_delate255')) { // 自动隐藏阅读权限 255 的帖子 - delate255(); - setTimeout(delate255, 2000); // 为了避免有时候网页加载太慢时没有隐藏成功的问题 - } - blockUsers('forum'); // 屏蔽用户(黑名单) - blockKeywords(); // 屏蔽关键词(帖子标题) + if (menu_value('menu_collapsedNowPost')) collapsedNowPost(); // 收起当前帖子预览(左键左右两侧空白处) + if (menu_value('menu_delate255')) delate255(); // 自动隐藏阅读权限 255 的帖子 + blockUsers('forum'); // 屏蔽用户(黑名单) + blockKeywords(); // 屏蔽关键词(帖子标题) if (patt_forum.test(location.pathname)) blockDOMNodeInserted(); // 监听插入事件(针对的是:有新的回复主题,点击查看) - }else if (patt_guide.test(location.search)) { // 导读帖子列表 + }else if (patt_guide.test(location.search)) { // 导读帖子列表 curSite = DBSite.guide; - } else if(location.pathname === '/search.php') { // 搜索结果列表 + } else if(location.pathname === '/search.php') { // 搜索结果列表 curSite = DBSite.search; - blockUsers('search'); // 屏蔽用户(黑名单) + blockUsers('search'); // 屏蔽用户(黑名单) } else if(location.pathname === '/home.php' && location.search.indexOf('mod=space&do=notice&view=mypost') > -1) { // 消息(帖子/点评/提到) - blockUsers('notice'); // 屏蔽用户(黑名单) + blockUsers('notice'); // 屏蔽用户(黑名单) } else if(location.pathname === '/home.php' && location.search === '?mod=space&do=pm') { // 消息(私人聊天) - blockUsers('pm'); // 屏蔽用户(黑名单) + blockUsers('pm'); // 屏蔽用户(黑名单) } curSite.pageUrl = ""; // 下一页URL @@ -168,6 +169,18 @@ if(menu_value('menu_autoSignIn'))autoSignIn(); // 自动签到(访问空间 10 次 = 20 积分) + // 显示在线状态 + function onlineStatus() { + document.querySelectorAll('[id^="favatar"]').forEach(function(item){ // 遍历所有帖子 + let icon = (item.querySelector('[id^="userinfo"] > .i.y em').innerText === '当前在线') ? '🌝' : '🌚'; + let divStatus = document.createElement('div'); + divStatus.style = 'position: absolute;margin: -8px 0 0 8px;padding: 0 1px 1.2px;background-color: #ffffff;border-radius: 50%;'; + divStatus.innerText = icon; + let mochu = item.querySelector('.avatar'); + mochu.parentNode.insertBefore(divStatus,mochu); + }) + } + // 自动签到(访问空间 10 次 = 20 积分) function autoSignIn() { if (!loginStatus) return @@ -372,10 +385,23 @@ } + // 收起当前帖子预览(左键左右两侧空白处) + function collapsedNowPost() { + //if (!menu_value('menu_collapsedNowAnswer')) return + document.body.onclick = function(event){ + if (event.target==this) { + document.querySelectorAll('[id^="threadPreviewTR_"] .showhide').forEach(function (el) { + el.click() + }); + } + } + } + + // 自动隐藏阅读权限 255 的帖子 function delate255() { if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ - let tbody = document.querySelectorAll('tbody[id^="normalthread_"] .common .xw1'); + let tbody = document.querySelectorAll('tbody[id^="normalthread_"] .xw1'); Array.from(tbody).forEach(function (_this) { if (_this.innerText === '255') { _this.parentNode.parentNode.parentNode.remove(); From 93d79f329a65c56761bbda937246ddcb6d3ad912 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 26 May 2021 19:43:52 +0800 Subject: [PATCH 0267/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E9=A2=84=E8=A7=88=E5=B8=96=E5=AD=90]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD;=20=E6=96=B0=E5=A2=9E=20[=E6=98=BE=E7=A4=BA=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=9C=A8=E7=BA=BF]=20=E5=8A=9F=E8=83=BD;=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20[=E5=B1=8F=E8=94=BD=E9=98=85=E8=AF=BB=E6=9D=83?= =?UTF-8?q?=E9=99=90=20255=20=E5=B8=96=E5=AD=90]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 8c3d183df..301919c7e 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -169,18 +169,6 @@ if(menu_value('menu_autoSignIn'))autoSignIn(); // 自动签到(访问空间 10 次 = 20 积分) - // 显示在线状态 - function onlineStatus() { - document.querySelectorAll('[id^="favatar"]').forEach(function(item){ // 遍历所有帖子 - let icon = (item.querySelector('[id^="userinfo"] > .i.y em').innerText === '当前在线') ? '🌝' : '🌚'; - let divStatus = document.createElement('div'); - divStatus.style = 'position: absolute;margin: -8px 0 0 8px;padding: 0 1px 1.2px;background-color: #ffffff;border-radius: 50%;'; - divStatus.innerText = icon; - let mochu = item.querySelector('.avatar'); - mochu.parentNode.insertBefore(divStatus,mochu); - }) - } - // 自动签到(访问空间 10 次 = 20 积分) function autoSignIn() { if (!loginStatus) return @@ -374,7 +362,7 @@ } - // 回到顶部(右键左右两侧空白处) + // 快捷回到顶部(右键左右两侧空白处) function backToTop() { document.body.oncontextmenu = function(event){ if (event.target==this) { @@ -385,9 +373,8 @@ } - // 收起当前帖子预览(左键左右两侧空白处) + // 收起帖子预览(左键左右两侧空白处) function collapsedNowPost() { - //if (!menu_value('menu_collapsedNowAnswer')) return document.body.onclick = function(event){ if (event.target==this) { document.querySelectorAll('[id^="threadPreviewTR_"] .showhide').forEach(function (el) { @@ -398,6 +385,19 @@ } + // 显示在线状态 + function onlineStatus() { + document.querySelectorAll('[id^="favatar"]').forEach(function(item){ // 遍历所有帖子 + let icon = (item.querySelector('[id^="userinfo"] > .i.y em').innerText === '当前在线') ? '🌝' : '🌚'; + let divStatus = document.createElement('div'); + divStatus.style = 'position: absolute;margin: -8px 0 0 8px;padding: 0 1px 1.2px;background-color: #ffffff;border-radius: 50%;'; + divStatus.innerText = icon; + let mochu = item.querySelector('.avatar'); + mochu.parentNode.insertBefore(divStatus,mochu); + }) + } + + // 自动隐藏阅读权限 255 的帖子 function delate255() { if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1){ From aaf0be8967e10ea61efa768ec88c3a4c725cecf6 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 2 Jun 2021 13:30:42 +0800 Subject: [PATCH 0268/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Release=20?= =?UTF-8?q?=E5=8A=A0=E9=80=9F=E6=8C=89=E9=92=AE=E5=9C=A8=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=EF=BC=88=E5=B0=8F=E5=B1=8F=E5=B9=95=EF=BC=89=E4=B8=8A=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 66686ff99..f3bf7c92f 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.5.1 +// @version 1.5.2 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -123,11 +123,17 @@ // Release function addRelease() { let html = document.getElementsByClassName('Box Box--condensed');if (!html) return + let divDisplay; + if (document.documentElement.clientWidth > 1000) { + divDisplay = 'display: flex;'; + } else { + divDisplay = 'display: block;'; + } Array.from(html).forEach(function (current) { current.querySelectorAll('.d-flex.Box-body > a').forEach(function (_this) { let href = _this.href.split('github.com'), url = [], - _html = `
    `; + _html = `
    `; for (let i=0;i a').forEach(function (_this) { let href = _this.href.split('github.com'), url = [], - _html = `
    `; + _html = `
    `; for (let i=0;i Date: Fri, 4 Jun 2021 11:35:11 +0800 Subject: [PATCH 0269/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E9=A2=84=E8=A7=88=E5=B8=96=E5=AD=90]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88=E6=94=B6=E8=B5=B7=E6=97=B6=E4=BC=9A=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E8=87=B3=E5=B8=96=E5=AD=90=E5=A4=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 301919c7e..b0e263653 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.8 +// @version 1.1.9 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处) // @match *://hostloc.com/* @@ -378,7 +378,12 @@ document.body.onclick = function(event){ if (event.target==this) { document.querySelectorAll('[id^="threadPreviewTR_"] .showhide').forEach(function (el) { - el.click() + if (el.parentNode.querySelector('[name="message"]').value === '') { // 避免快速回复过程中误点收起了 + let parentElement = el.parentNode.parentNode.parentNode.parentNode.parentNode, + top = parentElement.offsetTop + parentElement.offsetParent.offsetTop + parentElement.offsetParent.offsetParent.offsetTop; // 元素距离顶部的高度 + if (top < document.documentElement.scrollTop) window.scrollTo(0,top) // 帖子标题在上面时才会滚动到该帖子处 + el.click() + } }); } } From 665124b60881e605b7dd35c09c38826d405b85bc Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 4 Jun 2021 11:38:29 +0800 Subject: [PATCH 0270/2377] Update --- SteamWorkshopImageRepair.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SteamWorkshopImageRepair.user.js b/SteamWorkshopImageRepair.user.js index 7acb5b900..949acfa4b 100644 --- a/SteamWorkshopImageRepair.user.js +++ b/SteamWorkshopImageRepair.user.js @@ -4,7 +4,7 @@ // @version 1.0.0 // @author X.I.U // @description Fixed Steam Workshop image not showing -// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题 +// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题(Steam 不改的话,长期可用) // @match *://steamcommunity.com/sharedfiles/filedetails/* // @match *://steamcommunity.com/workshop/filedetails/* // @icon https://store.steampowered.com/favicon.ico @@ -15,4 +15,4 @@ if(typeof onYouTubeIframeAPIReady == 'function') { onYouTubeIframeAPIReady(); -} +} \ No newline at end of file From 9864d6e5f516dc65e2773d0b5c270454c6f2087a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 4 Jun 2021 13:01:36 +0800 Subject: [PATCH 0271/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=E4=B8=8E=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E6=96=87=E7=AB=A0=E5=AE=BD=E5=BA=A6=E4=B8=80=E8=87=B4?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 12309edc4..2c87cf87b 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.2.3 +// @version 1.2.4 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -143,8 +143,11 @@ `, style_3 = `/* 调整文章编辑页面与实际文章宽度一致 */ .PostEditor .RichText {min-width: 690px !important;} +.InputLike.PostEditor.Editable {min-width: 710px !important;border: none !important;padding: 0 10px !important;background-color: #22272e !important;} /* 及标题输入框内的文字大小 */ .WriteIndex-titleInput .Input {min-width: 690px !important;font-size: 24px;} +label.WriteIndex-titleInput.Input-wrapper.Input-wrapper--multiline {min-width: 710px !important;padding: 0 10px !important;background-color: #22272e !important;} + `, style_4 = `/* 向下翻时自动隐藏顶栏*/ header.is-hidden {display: none;} From 1ccef301c9b6240b674321d4eca27ab079362fd4 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 6 Jun 2021 11:49:19 +0800 Subject: [PATCH 0272/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=B8=96=E5=AD=90=E5=BF=AB=E9=80=9F=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=B8=A6=E7=AD=BE=E5=90=8D]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index b0e263653..c224ea7d0 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.1.9 +// @version 1.2.0 // @author X.I.U -// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处) +// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名 // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -151,7 +151,8 @@ if (menu_value('menu_delate255')) delate255(); // 自动隐藏阅读权限 255 的帖子 blockUsers('forum'); // 屏蔽用户(黑名单) blockKeywords(); // 屏蔽关键词(帖子标题) - if (patt_forum.test(location.pathname)) blockDOMNodeInserted(); // 监听插入事件(针对的是:有新的回复主题,点击查看) + vfastpostDOMNodeInserted(); // 监听插入事件(预览快速回复带签名) + if (patt_forum.test(location.pathname)) blockDOMNodeInserted(); //监听插入事件(有新的回复主题,点击查看) }else if (patt_guide.test(location.search)) { // 导读帖子列表 curSite = DBSite.guide; } else if(location.pathname === '/search.php') { // 搜索结果列表 @@ -299,7 +300,7 @@ } - // 监听插入事件(针对的是:有新的回复主题,点击查看) + // 监听插入事件(有新的回复主题,点击查看) function blockDOMNodeInserted() { let block = e => { if (e.target.innerText && e.target.innerText.indexOf('newthread') > -1) { @@ -313,6 +314,17 @@ } + // 监听插入事件(预览快速回复带签名) + function vfastpostDOMNodeInserted() { + let vfastpost = e => { + if (e.target.innerHTML && e.target.innerHTML.indexOf('id="vfastpost"') > -1) { + e.target.getElementsByTagName('form')[0].insertAdjacentHTML('afterbegin', ``); + } + } + document.addEventListener('DOMNodeInserted', vfastpost); // 监听插入事件 + } + + // 自动翻页 function pageLoading() { if (curSite.SiteTypeID > 0){ From 011ba71da7519dc730f9f505aeec34fc50e75c59 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 6 Jun 2021 11:52:48 +0800 Subject: [PATCH 0273/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=B8=96=E5=AD=90=E5=BF=AB=E9=80=9F=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=B8=A6=E7=AD=BE=E5=90=8D]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index c224ea7d0..b8ccab8b8 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -2,7 +2,7 @@ // @name 全球主机交流论坛增强 // @version 1.2.0 // @author X.I.U -// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、自动显示帖子内隐藏回复、自动隐藏阅读权限 255 的帖子、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名 +// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest @@ -26,10 +26,10 @@ ['menu_blockKeywords', '屏蔽关键词(帖子标题)', '屏蔽关键词(帖子标题)', false], ['menu_customBlockKeywords', '自定义屏蔽关键词', '自定义屏蔽关键词', []], ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], - ['menu_showhide', '显示隐藏回复', '显示隐藏回复', true], ['menu_backToTop', '快捷回到顶部(右键点击两侧空白处)', '快捷回到顶部', true], ['menu_collapsedNowPost', '收起预览帖子(左键点击两侧空白处)', '收起预览帖子', true], ['menu_onlineStatus', '显示是否在线', '显示是否在线', true], + ['menu_showhide', '显示帖子内隐藏回复', '显示帖子内隐藏回复', true], ['menu_delate255', '屏蔽阅读权限 255 帖子', '屏蔽阅读权限 255 帖子', true] ], menu_ID = []; for (let i=0;i Date: Sun, 6 Jun 2021 21:10:36 +0800 Subject: [PATCH 0274/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E7=94=A8=E6=88=B7]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88=E6=94=AF=E6=8C=81=E8=AF=84=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 60c616bc2..bf5341b90 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.4.2 +// @version 1.4.3 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -238,6 +238,7 @@ function blockUsers(type) { blockUsers_search(); break; } + blockUsers_comment(); // 评论区 function blockUsers_index() { let blockUsers = e => { @@ -315,6 +316,34 @@ function blockUsers(type) { } document.addEventListener('DOMNodeInserted', blockUsers); // 监听插入事件 } + + function blockUsers_comment() { + let blockUsers = e => { + if (e.target.innerHTML && e.target.querySelector('img.Avatar.UserLink-avatar[width="24"]')) { + let item = e.target.querySelectorAll('img.Avatar.UserLink-avatar[width="24"]') + item.forEach(function(item1){ // 遍历用户名 + menu_value('menu_customBlockUsers').forEach(function(item2){ // 遍历用户黑名单 + if (item1.alt === item2) { // 找到就删除该搜索结果 + if (item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'NestComment--rootCommentNoChild' || item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'NestComment--rootComment') { + item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } else if (item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'NestComment--rootCommentNoChild' || item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'NestComment--rootComment') { + item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } else if (item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'NestComment--child') { + item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } else if (item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'NestComment--child') { + item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } else if (item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'NestComment') { + item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } else if (item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'CommentItemV2') { + item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } + } + }) + }) + } + } + document.addEventListener('DOMNodeInserted', blockUsers); // 监听插入事件 + } } @@ -697,20 +726,24 @@ function questionInvitation(){ collapsedNowAnswer(".ContentLayout"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_people, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 + blockUsers(); // 屏蔽指定用户 } } else if (window.location.href.indexOf("zhuanlan") > -1){ // 文章 // backToTop("article.Post-Main.Post-NormalMain"); // 快捷返回顶部 backToTop("div.Post-Sub.Post-NormalSub"); // 快捷返回顶部 setInterval(topTime_zhuanlan, 300); // 置顶显示时间 + blockUsers(); // 屏蔽指定用户 } else if (window.location.href.indexOf("column") > -1) { // 专栏 // collapsedAnswer(); // 一键收起回答 collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_zhuanlan, 300); // 置顶显示时间 + blockUsers(); // 屏蔽指定用户 } else if (window.location.href.indexOf("people") > -1 || window.location.href.indexOf("org") > -1) { // 用户主页 // collapsedAnswer(); // 一键收起回答 collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 collapsedNowAnswer(".Profile-main"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_people, 300); // 置顶显示时间 + blockUsers(); // 屏蔽指定用户 } else { // 首页 // collapsedAnswer(); // 一键收起回答 collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 From 55481fd8cf070e0064c9613fc645ed88d064ad83 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:55:14 +0800 Subject: [PATCH 0275/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5]=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=94=B6=E8=97=8F=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index d12b4c43d..3ce779915 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.7 +// @version 1.2.8 // @author X.I.U // @description 自动签到、自动无缝翻页、屏蔽导读悬赏贴(最新发表页) // @match *://www.52pojie.cn/* @@ -116,8 +116,19 @@ scrollDelta: 899 } }, - search: { + favorite: { SiteTypeID: 5, + pager: { + type: 1, + nextLink: '//a[@class="nxt"][@href]', + pageElement: 'css;ul#favorite_ul > li', + HT_insert: ['css;ul#favorite_ul', 2], + replaceE: 'css;div.pg', + scrollDelta: 899 + } + }, + search: { + SiteTypeID: 6, pager: { type: 1, nextLink: '//a[@class="nxt"][@href]', @@ -147,6 +158,8 @@ delateReward(); // 屏蔽导读悬赏贴(最新发表) } else if (location.search.indexOf('mod=collection') > -1) { curSite = DBSite.collection; // 淘贴列表 + } else if (location.search.indexOf('do=favorite') > -1) { + curSite = DBSite.favorite; // 收藏列表 } else if (location.pathname === '/search.php') { curSite = DBSite.search; // 搜索结果列表 } From eec1aceea7bcf6a6f279f2533d7af5c16524ea3f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 16 Jun 2021 19:35:15 +0800 Subject: [PATCH 0276/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[3DM=E3=80=81?= =?UTF-8?q?=E6=B8=B8=E6=B0=91=E6=98=9F=E7=A9=BA]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 55 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 505ee21d0..2c4179191 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.2.2 +// @version 1.2.3 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -19,6 +19,9 @@ // @match *://www.centbrowser.net/* // @match *://pubmed.ncbi.nlm.nih.gov/?term=* // @match *://movie.douban.com/* +// @match *://search.douban.com/* +// @match *://www.3dmgame.com/bagua/*.html +// @match *://www.gamersky.com/ent/*/*.shtml // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -252,6 +255,39 @@ replaceE: 'css;.paginator', scrollDelta: 700 } + }, + douban_search: { + SiteTypeID: 18, + pager: { + type: 1, + nextLink: '//a[@class="next"][@href]', + pageElement: 'css;#root [class^="_"] [class^="sc-"]', + HT_insert: ['css;.paginator', 1], + replaceE: 'css;.paginator', + scrollDelta: 700 + } + }, + _3dmgame: { + SiteTypeID: 19, + pager: { + type: 1, + nextLink: '//li[@class="next"]/a[@href]', + pageElement: 'css;.news_warp_center > p', + HT_insert: ['css;.news_warp_center', 3], + replaceE: 'css;.pagewrap', + scrollDelta: 1000 + } + }, + gamersky: { + SiteTypeID: 20, + pager: { + type: 1, + nextLink: '//div[@class="page_css"]/a[text()="下一页"][@href]', + pageElement: 'css;.Mid2L_con > p', + HT_insert: ['css;.page_css', 1], + replaceE: 'css;.page_css', + scrollDelta: 1000 + } } }; @@ -331,6 +367,17 @@ curSite = DBSite.douban_subject_episode; } break; + case "search.douban.com": + curSite = DBSite.douban_search; + break; + case "www.3dmgame.com": + curSite = DBSite._3dmgame; + document.lastChild.appendChild(document.createElement('style')).textContent = `#Comments_wrap {display: none !important;}` // 隐藏评论区 + break; + case "www.gamersky.com": + curSite = DBSite.gamersky; + document.lastElementChild.appendChild(document.createElement('style')).textContent = `.Comment {display: none !important;}` // 隐藏评论区 + break; } curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动无缝翻页 @@ -473,7 +520,7 @@ if (curSite.pager) { let curPageEle = getElementByXpath(curSite.pager.nextLink); var url = this.getFullHref(curPageEle); - //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); if(url === '') return; if(curSite.pageUrl === url) return;// 避免重复加载相同的页面 curSite.pageUrl = url; @@ -485,7 +532,7 @@ timeout: 5000, onload: function (response) { try { - //console.log(`${response.responseText}`) + console.log(`${response.responseText}`) var newBody = ShowPager.createDocumentByString(response.responseText); let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; From 0bf478f787d96a1131e9ba26daff855d215e64c3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 16 Jun 2021 20:30:29 +0800 Subject: [PATCH 0277/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E5=85=B3=E9=94=AE=E8=AF=8D=EF=BC=88?= =?UTF-8?q?=E6=A0=87=E9=A2=98=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 135 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 133 insertions(+), 2 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index bf5341b90..934b92c48 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.4.3 +// @version 1.4.4 // @author X.I.U -// @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 +// @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽指定关键词(标题)、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico @@ -23,6 +23,8 @@ var menu_ALL = [ ['menu_backToTop', '快捷回到顶部(右键两侧空白处)', '快捷回到顶部', true], ['menu_blockUsers', '屏蔽指定用户', '屏蔽指定用户', false], ['menu_customBlockUsers', '自定义屏蔽用户', '自定义屏蔽用户', ['故事档案局', '盐选推荐', '盐选科普', '盐选成长计划', '知乎盐选会员', '知乎盐选创作者', '盐选心理', '盐选健康必修课', '盐选奇妙物语', '盐选生活馆', '盐选职场', '盐选文学甄选', '盐选作者小管家', '盐选博物馆', '盐选点金', '盐选测评室', '盐选科技前沿', '盐选会员精品']], + ['menu_blockKeywords', '屏蔽指定关键词', '屏蔽指定关键词', false], + ['menu_customBlockKeywords', '自定义屏蔽关键词', '自定义屏蔽关键词', []], ['menu_blockYanXuan', '屏蔽盐选内容', '屏蔽盐选内容', false], ['menu_publishTop', '置顶显示时间', '置顶显示时间', true], ['menu_allTime', '完整显示时间', '完整显示时间', true], @@ -45,6 +47,8 @@ function registerMenuCommand() { menu_ALL[i][3] = GM_getValue(menu_ALL[i][0]); if (menu_ALL[i][0] === 'menu_customBlockUsers') { menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){customBlockUsers()}); + } else if (menu_ALL[i][0] === 'menu_customBlockKeywords') { + menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){customBlockKeywords()}); } else { menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } @@ -347,6 +351,130 @@ function blockUsers(type) { } +// 自定义屏蔽关键词(标题) +function customBlockKeywords() { + let nowBlockKeywords = ''; + menu_value('menu_customBlockKeywords').forEach(function(item){nowBlockKeywords = nowBlockKeywords + '|' + item}) + let newBlockKeywords = prompt('编辑 [自定义屏蔽关键词]\n(不同关键词之间使用 "|" 分隔,例如:关键词A|关键词B|关键词C )', nowBlockKeywords.replace('|','')); + if (newBlockKeywords === '') { + GM_setValue('menu_customBlockKeywords', []); + registerMenuCommand(); // 重新注册脚本菜单 + } else if (newBlockKeywords != null) { + GM_setValue('menu_customBlockKeywords', newBlockKeywords.split('|')); + registerMenuCommand(); // 重新注册脚本菜单 + } +}; + + +// 屏蔽指定关键词(标题) +function blockKeywords(type) { + if (!menu_value('menu_blockKeywords')) return + if (!menu_value('menu_customBlockKeywords') || menu_value('menu_customBlockKeywords').length < 1) return + switch(type) { + case 'index': + blockKeywords_index(); + break; + case 'people': + blockKeywords_people(); + break; + case 'search': + blockKeywords_search(); + break; + } + + function blockKeywords_index() { + let blockKeywords = e => { + if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem-title').length > 0) { + let item = e.target.querySelector('h2.ContentItem-title meta[itemprop="name"]'); // 标题所在元素 + if (item) { + //console.log(item) + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + console.log(item.content); + item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } + }) + } else { // 如果是文章标题 + item = e.target.querySelector('.ContentItem.ArticleItem meta[itemprop="headline"]'); // 标题所在元素 + if (item) { + //console.log(item) + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + console.log('aaaaaaaa',item.content); + item.parentNode.parentNode.parentNode.remove(); + } + }) + } + } + } + } + document.addEventListener('DOMNodeInserted', blockKeywords); // 监听插入事件 + } + + + function blockKeywords_people() { + let blockKeywords = e => { + if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem-title').length > 0) { + let item = e.target.querySelector('h2.ContentItem-title meta[itemprop="name"]'); // 标题所在元素 + if (item) { + //console.log(item) + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + console.log(item.content); + item.parentNode.parentNode.parentNode.parentNode.remove(); + } + }) + } else { // 如果是文章标题 + item = e.target.querySelector('.ContentItem.ArticleItem meta[itemprop="headline"]'); // 标题所在元素 + if (item) { + //console.log(item) + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + console.log('aaaaaaaa',item.content); + item.parentNode.parentNode.remove(); + } + }) + } + } + } + } + document.addEventListener('DOMNodeInserted', blockKeywords); // 监听插入事件 + } + + + function blockKeywords_search() { + let blockKeywords = e => { + //if (e.target.innerHTML) console.log(e.target.innerHTML) + if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem-title').length > 0) { + //console.log(e.target.innerHTML) + let item = e.target.querySelector('h2.ContentItem-title meta[itemprop="name"]'); // 标题所在元素 + if (item) { + //console.log(item) + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + console.log(item.content); + item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } + }) + } else { // 如果是文章标题 + item = e.target.querySelector('h2.ContentItem-title a[data-za-detail-view-id]'); // 标题所在元素 + if (item) { + //console.log(item) + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item.innerText.indexOf(item1) > -1) { // 找到就删除该信息流 + console.log('aaaaaaaa',item.content); + item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } + }) + } + } + } + } + document.addEventListener('DOMNodeInserted', blockKeywords); // 监听插入事件 + } +} + + // 屏蔽盐选内容 function blockYanXuan() { if (!menu_value('menu_blockYanXuan')) return @@ -719,6 +847,7 @@ function questionInvitation(){ setInterval(topTime_search, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 blockUsers('search'); // 屏蔽指定用户 + blockKeywords('search'); // 屏蔽指定关键词 } else if (window.location.href.indexOf("topic") > -1) { // 话题页 // if (window.location.href.indexOf("hot") > -1 || window.location.href.indexOf("top-answers") > -1) { // 仅限 [讨论] [精华] collapsedAnswer(); // 一键收起回答 @@ -744,6 +873,7 @@ function questionInvitation(){ collapsedNowAnswer(".Profile-main"); // 收起当前回答 + 快捷返回顶部 setInterval(topTime_people, 300); // 置顶显示时间 blockUsers(); // 屏蔽指定用户 + blockKeywords('people'); // 屏蔽指定关键词 } else { // 首页 // collapsedAnswer(); // 一键收起回答 collapsedNowAnswer("main div"); // 收起当前回答 + 快捷返回顶部 @@ -751,5 +881,6 @@ function questionInvitation(){ setInterval(topTime_index, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 blockUsers('index'); // 屏蔽指定用户 + blockKeywords('index'); // 屏蔽指定关键词 } })(); \ No newline at end of file From 272a964ab8e56aff0235d12a730feb1a2f89db8c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 16 Jun 2021 20:47:06 +0800 Subject: [PATCH 0278/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E5=85=B3=E9=94=AE=E8=AF=8D=EF=BC=88?= =?UTF-8?q?=E6=A0=87=E9=A2=98=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 45 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 934b92c48..fb6143aa1 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -374,6 +374,10 @@ function blockKeywords(type) { case 'index': blockKeywords_index(); break; + case 'topic': + blockKeywords_topic(); + blockKeywords_people(); + break; case 'people': blockKeywords_people(); break; @@ -400,7 +404,7 @@ function blockKeywords(type) { //console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 - console.log('aaaaaaaa',item.content); + console.log('文章',item.content); item.parentNode.parentNode.parentNode.remove(); } }) @@ -412,12 +416,41 @@ function blockKeywords(type) { } + function blockKeywords_topic() { + let item = document.querySelectorAll('h2.ContentItem-title meta[itemprop="name"]'); // 标题所在元素 + if (item.length > 0) { + //console.log(item) + item.forEach(function(item2){ + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item2.content.indexOf(item1) > -1) { // 找到就删除该信息流 + console.log(item2.content); + item2.parentNode.parentNode.parentNode.parentNode.remove(); + } + }) + }) + } else { // 如果是文章标题 + item = document.querySelectorAll('.ContentItem.ArticleItem meta[itemprop="headline"]'); // 标题所在元素 + if (item.length > 0) { + //console.log(item) + item.forEach(function(item2){ + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item2.content.indexOf(item1) > -1) { // 找到就删除该信息流 + console.log('文章',item2.content); + item2.parentNode.parentNode.remove(); + } + }) + }) + } + } + } + + function blockKeywords_people() { let blockKeywords = e => { if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem-title').length > 0) { let item = e.target.querySelector('h2.ContentItem-title meta[itemprop="name"]'); // 标题所在元素 if (item) { - //console.log(item) + console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 console.log(item.content); @@ -427,10 +460,10 @@ function blockKeywords(type) { } else { // 如果是文章标题 item = e.target.querySelector('.ContentItem.ArticleItem meta[itemprop="headline"]'); // 标题所在元素 if (item) { - //console.log(item) + console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 - console.log('aaaaaaaa',item.content); + console.log('文章',item.content); item.parentNode.parentNode.remove(); } }) @@ -444,6 +477,7 @@ function blockKeywords(type) { function blockKeywords_search() { let blockKeywords = e => { + if (location.search.indexOf('&type=content') === -1) return //if (e.target.innerHTML) console.log(e.target.innerHTML) if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem-title').length > 0) { //console.log(e.target.innerHTML) @@ -462,7 +496,7 @@ function blockKeywords(type) { //console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 if (item.innerText.indexOf(item1) > -1) { // 找到就删除该信息流 - console.log('aaaaaaaa',item.content); + console.log('文章',item.content); item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); } }) @@ -856,6 +890,7 @@ function questionInvitation(){ setInterval(topTime_people, 300); // 置顶显示时间 EventXMLHttpRequest(); // 区分问题文章 blockUsers(); // 屏蔽指定用户 + blockKeywords('topic'); // 屏蔽指定关键词 } } else if (window.location.href.indexOf("zhuanlan") > -1){ // 文章 // backToTop("article.Post-Main.Post-NormalMain"); // 快捷返回顶部 From ae63aea475d86085330545483421db3583258c42 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 16 Jun 2021 21:03:52 +0800 Subject: [PATCH 0279/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E5=85=B3=E9=94=AE=E8=AF=8D=EF=BC=88?= =?UTF-8?q?=E6=A0=87=E9=A2=98=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index fb6143aa1..f504315f7 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.4.4 +// @version 1.4.5 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽指定关键词(标题)、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -393,7 +393,7 @@ function blockKeywords(type) { if (item) { //console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + if (item.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log(item.content); item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); } @@ -403,7 +403,7 @@ function blockKeywords(type) { if (item) { //console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + if (item.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log('文章',item.content); item.parentNode.parentNode.parentNode.remove(); } @@ -422,7 +422,7 @@ function blockKeywords(type) { //console.log(item) item.forEach(function(item2){ menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item2.content.indexOf(item1) > -1) { // 找到就删除该信息流 + if (item2.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log(item2.content); item2.parentNode.parentNode.parentNode.parentNode.remove(); } @@ -434,7 +434,7 @@ function blockKeywords(type) { //console.log(item) item.forEach(function(item2){ menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item2.content.indexOf(item1) > -1) { // 找到就删除该信息流 + if (item2.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log('文章',item2.content); item2.parentNode.parentNode.remove(); } @@ -452,7 +452,7 @@ function blockKeywords(type) { if (item) { console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + if (item.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log(item.content); item.parentNode.parentNode.parentNode.parentNode.remove(); } @@ -462,7 +462,7 @@ function blockKeywords(type) { if (item) { console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + if (item.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log('文章',item.content); item.parentNode.parentNode.remove(); } @@ -485,7 +485,7 @@ function blockKeywords(type) { if (item) { //console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item.content.indexOf(item1) > -1) { // 找到就删除该信息流 + if (item.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log(item.content); item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); } @@ -495,7 +495,7 @@ function blockKeywords(type) { if (item) { //console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item.innerText.indexOf(item1) > -1) { // 找到就删除该信息流 + if (item.innerText.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log('文章',item.content); item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); } From 97d91cb7f7e1a58f5ecb5a546803ae6bceb5f80c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 16 Jun 2021 21:05:53 +0800 Subject: [PATCH 0280/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E5=85=B3=E9=94=AE=E8=AF=8D=EF=BC=88?= =?UTF-8?q?=E6=A0=87=E9=A2=98=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index f504315f7..1aa02f842 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -355,7 +355,7 @@ function blockUsers(type) { function customBlockKeywords() { let nowBlockKeywords = ''; menu_value('menu_customBlockKeywords').forEach(function(item){nowBlockKeywords = nowBlockKeywords + '|' + item}) - let newBlockKeywords = prompt('编辑 [自定义屏蔽关键词]\n(不同关键词之间使用 "|" 分隔,例如:关键词A|关键词B|关键词C )', nowBlockKeywords.replace('|','')); + let newBlockKeywords = prompt('编辑 [自定义屏蔽关键词]\n(不同关键词之间使用 "|" 分隔,例如:关键词A|关键词B|关键词C \n(关键词不区分大小写', nowBlockKeywords.replace('|','')); if (newBlockKeywords === '') { GM_setValue('menu_customBlockKeywords', []); registerMenuCommand(); // 重新注册脚本菜单 From bf3d934ed8cfb29ee6fca921cb2ddfe8531cd306 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 17 Jun 2021 11:51:06 +0800 Subject: [PATCH 0281/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=8D=83?= =?UTF-8?q?=E5=9B=BE=E7=BD=91]=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 61 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 2c4179191..6f1bb9032 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.2.3 +// @version 1.2.4 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、千图网、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -22,6 +22,7 @@ // @match *://search.douban.com/* // @match *://www.3dmgame.com/bagua/*.html // @match *://www.gamersky.com/ent/*/*.shtml +// @match *://www.58pic.com/* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -288,6 +289,34 @@ replaceE: 'css;.page_css', scrollDelta: 1000 } + }, + _58pic: { + SiteTypeID: 21, + pager: { + type: 1, + nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]', + pageElement: 'css;.pic-box > .qtw-card', + HT_insert: ['css;.pic-box', 3], + replaceE: 'css;.page-box', + scrollDelta: 2000 + }, + function: { + before: _58pic_beforeFunction + } + }, + _58pic_c: { + SiteTypeID: 22, + pager: { + type: 1, + nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]', + pageElement: 'css;.list-box > .qtw-card', + HT_insert: ['css;.list-box', 3], + replaceE: 'css;.page-box', + scrollDelta: 4000 + }, + function: { + before: _58pic_beforeFunction + } } }; @@ -378,6 +407,13 @@ curSite = DBSite.gamersky; document.lastElementChild.appendChild(document.createElement('style')).textContent = `.Comment {display: none !important;}` // 隐藏评论区 break; + case "www.58pic.com": + if (location.pathname.indexOf("/tupian/") > -1) { + curSite = DBSite._58pic; + } else if (location.pathname.indexOf("/c/") > -1) { + curSite = DBSite._58pic_c; + } + break; } curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动无缝翻页 @@ -463,6 +499,23 @@ } + // iplaysoft 的插入前函数 + function _58pic_beforeFunction(pageElems) { + let is_one = document.querySelector(".qtw-card.place-box.is-one"); + if (is_one && is_one.style.display != "none") { + is_one.setAttribute("style", "display: none;") + } + pageElems.forEach(function (one) { + let now = one.querySelector("img.lazy") + if (now && now.getAttribute('src') === "//icon.qiantucdn.com/static/images/qtw-card/card-place.png") { + now.setAttribute("src", now.dataset.original) + now.setAttribute("style", "display: block;") + } + }); + return pageElems + } + + // 滚动条事件 function windowScroll(fn1) { var beforeScrollTop = document.documentElement.scrollTop, @@ -520,7 +573,7 @@ if (curSite.pager) { let curPageEle = getElementByXpath(curSite.pager.nextLink); var url = this.getFullHref(curPageEle); - console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); + //console.log(`${url} ${curPageEle} ${curSite.pageUrl}`); if(url === '') return; if(curSite.pageUrl === url) return;// 避免重复加载相同的页面 curSite.pageUrl = url; @@ -532,7 +585,7 @@ timeout: 5000, onload: function (response) { try { - console.log(`${response.responseText}`) + //console.log(`${response.responseText}`) var newBody = ShowPager.createDocumentByString(response.responseText); let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody); let toElement = getAllElements(curSite.pager.HT_insert[0])[0]; From 4709280af33f5cc33fb873dced86eb5fa541671c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 17 Jun 2021 17:00:08 +0800 Subject: [PATCH 0282/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E6=8C=87=E5=AE=9A=E5=85=B3=E9=94=AE=E8=AF=8D]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=88=E9=A6=96=E9=A1=B5=E5=92=8C=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C=E9=81=97=E6=BC=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 82 +++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 28 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 1aa02f842..2358aeeaf 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.4.5 +// @version 1.4.6 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽指定关键词(标题)、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -372,6 +372,7 @@ function blockKeywords(type) { if (!menu_value('menu_customBlockKeywords') || menu_value('menu_customBlockKeywords').length < 1) return switch(type) { case 'index': + blockKeywords_index_(); blockKeywords_index(); break; case 'topic': @@ -386,6 +387,38 @@ function blockKeywords(type) { break; } + function blockKeywords_index_() { + let item = document.querySelectorAll('h2.ContentItem-title meta[itemprop="name"]'); // 标题所在元素 + if (item.length > 0) { + item.forEach(function(item2){ + //console.log(item2) + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item2.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 + console.log(item2.content); + if (item2.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'Feed') { + item2.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } else { + item2.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } + } + }) + }) + } + // 如果是文章标题 + item = document.querySelectorAll('.ContentItem.ArticleItem meta[itemprop="headline"]'); // 标题所在元素 + if (item.length > 0) { + item.forEach(function(item2){ + //console.log(item2) + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item2.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 + console.log('文章',item2.content); + item2.parentNode.parentNode.parentNode.remove(); + } + }) + }) + } + } + function blockKeywords_index() { let blockKeywords = e => { if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem-title').length > 0) { @@ -395,7 +428,11 @@ function blockKeywords(type) { menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 if (item.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 console.log(item.content); - item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + if (item.parentNode.parentNode.parentNode.parentNode.parentNode.className === 'Feed') { + item.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } else { + item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); + } } }) } else { // 如果是文章标题 @@ -428,19 +465,19 @@ function blockKeywords(type) { } }) }) - } else { // 如果是文章标题 - item = document.querySelectorAll('.ContentItem.ArticleItem meta[itemprop="headline"]'); // 标题所在元素 - if (item.length > 0) { - //console.log(item) - item.forEach(function(item2){ - menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item2.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 - console.log('文章',item2.content); - item2.parentNode.parentNode.remove(); - } - }) + } + // 如果是文章标题 + item = document.querySelectorAll('.ContentItem.ArticleItem meta[itemprop="headline"]'); // 标题所在元素 + if (item.length > 0) { + //console.log(item) + item.forEach(function(item2){ + menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 + if (item2.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 + console.log('文章',item2.content); + item2.parentNode.parentNode.remove(); + } }) - } + }) } } @@ -481,26 +518,15 @@ function blockKeywords(type) { //if (e.target.innerHTML) console.log(e.target.innerHTML) if (e.target.innerHTML && e.target.getElementsByClassName('ContentItem-title').length > 0) { //console.log(e.target.innerHTML) - let item = e.target.querySelector('h2.ContentItem-title meta[itemprop="name"]'); // 标题所在元素 + let item = e.target.querySelector('h2.ContentItem-title a[data-za-detail-view-id]'); // 标题所在元素 if (item) { //console.log(item) menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item.content.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 - console.log(item.content); + if (item.innerText.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 + console.log(item.innerText); item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); } }) - } else { // 如果是文章标题 - item = e.target.querySelector('h2.ContentItem-title a[data-za-detail-view-id]'); // 标题所在元素 - if (item) { - //console.log(item) - menu_value('menu_customBlockKeywords').forEach(function(item1){ // 遍历关键词黑名单 - if (item.innerText.toLowerCase().indexOf(item1.toLowerCase()) > -1) { // 找到就删除该信息流 - console.log('文章',item.content); - item.parentNode.parentNode.parentNode.parentNode.parentNode.remove(); - } - }) - } } } } From 3f8c2c7f5e78c721a588543476b4d4ab562af5d0 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 17 Jun 2021 17:05:16 +0800 Subject: [PATCH 0283/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20HostLoc=20?= =?UTF-8?q?=E5=8F=A6=E4=B8=80=E4=B8=AA=E5=9F=9F=E5=90=8D=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index b8ccab8b8..f57de417c 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,9 +1,10 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.0 +// @version 1.2.1 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* +// @match *://91ai.net/* // @icon https://www.hostloc.com/favicon.ico // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -181,7 +182,7 @@ let url_list = [], url = 0; // 随机生成 12 个空间地址(2 个冗余) - for(let i = 0;i < 12;i++){url_list[i] = "https://hostloc.com/space-uid-" + Math.floor(Math.random()*(50000-10000+1)+10000) + ".html";} + for(let i = 0;i < 12;i++){url_list[i] = "https://" + location.host + "/space-uid-" + Math.floor(Math.random()*(50000-10000+1)+10000) + ".html";} // 每 5 秒访问一次(避免触发网站防御机制) GM_setValue('menu_signingIn', true); let signIn = setInterval(function(){ From 73f6fd762cba5949f6efa534df0ef29410f9f807 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 18 Jun 2021 15:54:26 +0800 Subject: [PATCH 0284/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index df46649e0..87eb96feb 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.1 +// @version 1.0.2 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -17,7 +17,7 @@ (function() { var menu_ALL = [ - ['menu_runDuringTheDay', '白天保持开启 (比晚上更亮一点)', '白天保持开启', true], + ['menu_runDuringTheDay', '白天保持开启 (比晚上亮一点点)', '白天保持开启', true], ['menu_darkModeType', '点击切换模式', '点击切换模式', 1] ], menu_ID = []; for (let i=0;i Date: Fri, 18 Jun 2021 18:01:51 +0800 Subject: [PATCH 0285/2377] =?UTF-8?q?=E6=8E=92=E9=99=A4=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E8=A7=86=E9=A2=91=E7=BD=91=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 87eb96feb..6fc7ecaea 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,9 +1,14 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.2 +// @version 1.0.3 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* +// @exclude *://v.qq.com/* +// @exclude *://*.iqiyi.com/* +// @exclude *://*.youku.com/* +// @exclude *://*.mgtv.com/* +// @exclude *://tv.cctv.com/* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand From 4a27ef430df54e7e6a978f5ca633984d93a89d18 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 19 Jun 2021 13:34:37 +0800 Subject: [PATCH 0286/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 6fc7ecaea..2355f031f 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.3 +// @version 1.0.4 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -98,7 +98,7 @@ style_Add = document.createElement('style'), hours = new Date().getHours(), style = ``, - style_00 = `body {background-color: #ffffff;}`, + style_00 = `html {background-color: #ffffff;}`, style_11 = `html {filter: brightness(80%) !important;}`, style_11_firefox = `html {filter: brightness(80%) !important; background-image: url();}`, style_12 = `html {filter: brightness(70%) !important;}`, @@ -111,11 +111,12 @@ style_31_firefox = `html {filter: invert(80%) !important;} img, video {filter: invert(1) !important; background-image: url();}`; // 判断网页是否没有设置背景颜色(没有背景颜色会导致滤镜对背景颜色无效) - if (document.body) { + /*if (document.body) { + console.log(window.getComputedStyle(document.body).backgroundColor) rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '); grayLevel = rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2]; if (grayLevel === "000") style += style_00 - } + }*/ // Firefox 浏览器需要特殊对待 if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { @@ -161,18 +162,18 @@ } // 为了避免 body 还没加载导致无法检查是否设置背景颜色的备用措施 - if (!grayLevel) { - let timer2 = setInterval(function(){ - if (document.body) { - let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '), - style_Add1 = document.createElement('style'); - if (rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2] === "000") { - style_Add1.innerHTML = style_00; - document.head.appendChild(style_Add1); - } - clearInterval(timer2); + //if (!grayLevel) { + setTimeout(function(){ + if (document.body) { + console.log(window.getComputedStyle(document.body).backgroundColor) + let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '), + style_Add1 = document.createElement('style'); + if (rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2] === "000") { + style_Add1.innerHTML = style_00; + document.head.appendChild(style_Add1); } - }, 1); - } + } + }, 100); + //} } })(); \ No newline at end of file From abf33612120c44328e16c51cee9ee2e3008b0955 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 20 Jun 2021 16:37:31 +0800 Subject: [PATCH 0287/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=B3=A8=E5=85=A5=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 2355f031f..47397fbbd 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.4 +// @version 1.0.5 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -148,9 +148,9 @@ style += style_31; break; } - style_Add.innerHTML = style; - //document.lastChild.appendChild(document.createElement("style")).textContent = style; - if (document.head) { + //style_Add.innerHTML = style; + document.lastChild.appendChild(document.createElement("style")).textContent = style; + /*if (document.head) { document.head.appendChild(style_Add); } else { // 为了避免脚本运行的时候 head 还没加载导致报错 let timer = setInterval(function(){ @@ -159,18 +159,19 @@ clearInterval(timer); } }, 1); - } + }*/ // 为了避免 body 还没加载导致无法检查是否设置背景颜色的备用措施 //if (!grayLevel) { setTimeout(function(){ if (document.body) { console.log(window.getComputedStyle(document.body).backgroundColor) - let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '), - style_Add1 = document.createElement('style'); + let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '); + //style_Add1 = document.createElement('style'); if (rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2] === "000") { - style_Add1.innerHTML = style_00; - document.head.appendChild(style_Add1); + //style_Add1.innerHTML = style_00; + //document.head.appendChild(style_Add1); + document.lastChild.appendChild(document.createElement("style")).textContent = style_00; } } }, 100); From 0f09597bb73b8ca9548f268cdd40c776bff6959e Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 21 Jun 2021 10:45:21 +0800 Subject: [PATCH 0288/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5]=20=E6=80=BB?= =?UTF-8?q?=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index f57de417c..621ad4844 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.1 +// @version 1.2.2 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* @@ -26,6 +26,7 @@ ['menu_customBlockUsers', '自定义屏蔽用户', '自定义屏蔽用户', []], ['menu_blockKeywords', '屏蔽关键词(帖子标题)', '屏蔽关键词(帖子标题)', false], ['menu_customBlockKeywords', '自定义屏蔽关键词', '自定义屏蔽关键词', []], + ['menu_pageLoading', '自动无缝翻页(总开关)', '自动无缝翻页', true], ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_backToTop', '快捷回到顶部(右键点击两侧空白处)', '快捷回到顶部', true], ['menu_collapsedNowPost', '收起预览帖子(左键点击两侧空白处)', '收起预览帖子', true], @@ -328,6 +329,7 @@ // 自动翻页 function pageLoading() { + if (!menu_value('menu_pageLoading')) return if (curSite.SiteTypeID > 0){ windowScroll(function (direction, e) { if (direction === "down") { // 下滑才准备翻页 From 57d844641bc463b9094f652d05536481553a8575 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 21 Jun 2021 22:28:10 +0800 Subject: [PATCH 0289/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 47397fbbd..ee259760e 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.5 +// @version 1.0.6 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -14,6 +14,7 @@ // @grant GM_unregisterMenuCommand // @grant GM_getValue // @grant GM_setValue +// @grant GM_notification // @noframes // @license GPL-3.0 License // @run-at document-start @@ -23,6 +24,7 @@ (function() { var menu_ALL = [ ['menu_runDuringTheDay', '白天保持开启 (比晚上亮一点点)', '白天保持开启', true], + ['menu_autoRecognition', '排除自带暗黑模式的网页 (beta)', '排除自带暗黑模式的网页 (beta)', true], ['menu_darkModeType', '点击切换模式', '点击切换模式', 1] ], menu_ID = []; for (let i=0;i -1) { style_11 = style_11_firefox @@ -148,33 +140,26 @@ style += style_31; break; } - //style_Add.innerHTML = style; - document.lastChild.appendChild(document.createElement("style")).textContent = style; - /*if (document.head) { - document.head.appendChild(style_Add); - } else { // 为了避免脚本运行的时候 head 还没加载导致报错 - let timer = setInterval(function(){ - if (document.head) { - document.head.appendChild(style_Add); - clearInterval(timer); - } - }, 1); - }*/ + style_Add.id = 'XIU2DarkMode'; + document.lastChild.appendChild(style_Add).textContent = style; // 为了避免 body 还没加载导致无法检查是否设置背景颜色的备用措施 - //if (!grayLevel) { setTimeout(function(){ if (document.body) { - console.log(window.getComputedStyle(document.body).backgroundColor) let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '); - //style_Add1 = document.createElement('style'); + let grayLevel = rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2]; + console.log(grayLevel) + console.log(window.getComputedStyle(document.body).backgroundColor) + if (rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2] === "000") { - //style_Add1.innerHTML = style_00; - //document.head.appendChild(style_Add1); document.lastChild.appendChild(document.createElement("style")).textContent = style_00; + } else if (grayLevel < 898989) { + if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) + console.log('检测到当前网页自带暗黑模式,停用本脚本ing...') + document.getElementById('XIU2DarkMode').remove(); + } } } }, 100); - //} } })(); \ No newline at end of file From e1e908301dd5dfda147ac76d4fff144a09a01b60 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 13:03:41 +0800 Subject: [PATCH 0290/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index ee259760e..2590e3811 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.6 +// @version 1.0.7 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -143,23 +143,24 @@ style_Add.id = 'XIU2DarkMode'; document.lastChild.appendChild(style_Add).textContent = style; - // 为了避免 body 还没加载导致无法检查是否设置背景颜色的备用措施 - setTimeout(function(){ + // 为了避免 body 还没加载导致无法检查是否设置背景颜色 + let timer = setInterval(function(){ if (document.body) { - let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace ('rgb(', '').replace ('rgba(', '').replace (')', '').split (', '); + let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace('rgb(', '').replace('rgba(', '').replace(')', '').split(', '); let grayLevel = rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2]; console.log(grayLevel) console.log(window.getComputedStyle(document.body).backgroundColor) - if (rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2] === "000") { + if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)') { // 如果 body 没有 CSS 背景颜色,那就需要添加一个,否则影响滤镜 document.lastChild.appendChild(document.createElement("style")).textContent = style_00; - } else if (grayLevel < 898989) { + } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || grayLevel < 898989) { if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) console.log('检测到当前网页自带暗黑模式,停用本脚本ing...') document.getElementById('XIU2DarkMode').remove(); } } + clearInterval(timer); } - }, 100); + }, 10); } })(); \ No newline at end of file From 460436a2259de5955b208b0768a1208b3b7ccfdb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 13:18:33 +0800 Subject: [PATCH 0291/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 2590e3811..c01ff504c 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -146,16 +146,14 @@ // 为了避免 body 还没加载导致无法检查是否设置背景颜色 let timer = setInterval(function(){ if (document.body) { - let rgbValueArry = window.getComputedStyle(document.body).backgroundColor.replace('rgb(', '').replace('rgba(', '').replace(')', '').split(', '); - let grayLevel = rgbValueArry [0] + rgbValueArry [1] + rgbValueArry [2]; - console.log(grayLevel) console.log(window.getComputedStyle(document.body).backgroundColor) - - if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)') { // 如果 body 没有 CSS 背景颜色,那就需要添加一个,否则影响滤镜 - document.lastChild.appendChild(document.createElement("style")).textContent = style_00; - } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || grayLevel < 898989) { + if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)') { + // 如果 body 没有 CSS 背景颜色,那就需要添加一个背景颜色,否则影响滤镜效果 + document.lastChild.appendChild(document.createElement('style')).textContent = style_00; + } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor.replace(/rgb|rgba|\(|\)|,| /g, '') < 898989) { + // 如果是黑色 (等于0,0,0) 或深色 (小于 88,88,88),就停用本脚本滤镜 if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) - console.log('检测到当前网页自带暗黑模式,停用本脚本ing...') + console.log('检测到当前网页自带暗黑模式,停用本脚本滤镜...') document.getElementById('XIU2DarkMode').remove(); } } From 1c64703b618cdd72bfc344e20fd5327b964ecf21 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 14:20:14 +0800 Subject: [PATCH 0292/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index c01ff504c..28c87b947 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.7 +// @version 1.0.8 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -144,20 +144,22 @@ document.lastChild.appendChild(style_Add).textContent = style; // 为了避免 body 还没加载导致无法检查是否设置背景颜色 - let timer = setInterval(function(){ + let timer = setInterval(function(){ // 每 10 毫秒检查一下 body 是否已存在(onload 太晚了,只能这么干) if (document.body) { - console.log(window.getComputedStyle(document.body).backgroundColor) - if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)') { - // 如果 body 没有 CSS 背景颜色,那就需要添加一个背景颜色,否则影响滤镜效果 - document.lastChild.appendChild(document.createElement('style')).textContent = style_00; - } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor.replace(/rgb|rgba|\(|\)|,| /g, '') < 898989) { - // 如果是黑色 (等于0,0,0) 或深色 (小于 88,88,88),就停用本脚本滤镜 - if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) - console.log('检测到当前网页自带暗黑模式,停用本脚本滤镜...') - document.getElementById('XIU2DarkMode').remove(); + setTimeout(function(){ // 为了避免太快 body 的 CSS 还没加载上,先延迟 100 毫秒(缺点就是可能会出现短暂一闪而过的暗黑滤镜) + console.log(window.getComputedStyle(document.lastChild).backgroundColor, window.getComputedStyle(document.body).backgroundColor) + if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastChild).backgroundColor === 'rgba(0, 0, 0, 0)') { + // 如果 body 没有 CSS 背景颜色,那就需要添加一个背景颜色,否则影响滤镜效果 + document.lastChild.appendChild(document.createElement('style')).textContent = style_00; + } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor.replace(/rgb|rgba|\(|\)|,| /g, '') < 898989) { + // 如果是黑色 (等于0,0,0) 或深色 (小于 88,88,88),就停用本脚本滤镜 + if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) + console.log('检测到当前网页自带暗黑模式,停用本脚本滤镜...') + document.getElementById('XIU2DarkMode').remove(); + } } - } - clearInterval(timer); + clearInterval(timer); + }, 100); } }, 10); } From 7d91824a774d42d438534a56d798e6fae767822c Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 14:34:00 +0800 Subject: [PATCH 0293/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 28c87b947..e597b2c5a 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -146,6 +146,7 @@ // 为了避免 body 还没加载导致无法检查是否设置背景颜色 let timer = setInterval(function(){ // 每 10 毫秒检查一下 body 是否已存在(onload 太晚了,只能这么干) if (document.body) { + clearInterval(timer); // 取消定时器(每 10 毫秒一次的) setTimeout(function(){ // 为了避免太快 body 的 CSS 还没加载上,先延迟 100 毫秒(缺点就是可能会出现短暂一闪而过的暗黑滤镜) console.log(window.getComputedStyle(document.lastChild).backgroundColor, window.getComputedStyle(document.body).backgroundColor) if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastChild).backgroundColor === 'rgba(0, 0, 0, 0)') { @@ -158,7 +159,6 @@ document.getElementById('XIU2DarkMode').remove(); } } - clearInterval(timer); }, 100); } }, 10); From 82801bb63e61c85bd49c15db40abc5039a85d83f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 15:00:12 +0800 Subject: [PATCH 0294/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index e597b2c5a..b3c11a35e 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.8 +// @version 1.0.9 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -144,15 +144,15 @@ document.lastChild.appendChild(style_Add).textContent = style; // 为了避免 body 还没加载导致无法检查是否设置背景颜色 - let timer = setInterval(function(){ // 每 10 毫秒检查一下 body 是否已存在(onload 太晚了,只能这么干) + let timer = setInterval(function(){ // 每 10 毫秒检查一下 body 是否已存在 if (document.body) { clearInterval(timer); // 取消定时器(每 10 毫秒一次的) setTimeout(function(){ // 为了避免太快 body 的 CSS 还没加载上,先延迟 100 毫秒(缺点就是可能会出现短暂一闪而过的暗黑滤镜) - console.log(window.getComputedStyle(document.lastChild).backgroundColor, window.getComputedStyle(document.body).backgroundColor) + console.log('html:', window.getComputedStyle(document.lastChild).backgroundColor, 'body:', window.getComputedStyle(document.body).backgroundColor) if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastChild).backgroundColor === 'rgba(0, 0, 0, 0)') { // 如果 body 没有 CSS 背景颜色,那就需要添加一个背景颜色,否则影响滤镜效果 document.lastChild.appendChild(document.createElement('style')).textContent = style_00; - } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor.replace(/rgb|rgba|\(|\)|,| /g, '') < 898989) { + } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor.replace(/rgb|rgba|\(|\)|,| /g, '') < 898989 || window.getComputedStyle(document.lastChild).backgroundColor.replace(/rgb|rgba|\(|\)|,| /g, '') < 898989) { // 如果是黑色 (等于0,0,0) 或深色 (小于 88,88,88),就停用本脚本滤镜 if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) console.log('检测到当前网页自带暗黑模式,停用本脚本滤镜...') From 12599b7605efe2da40eed11081e3904c464a14c3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 17:21:43 +0800 Subject: [PATCH 0295/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=9F=90BT]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index 6f1bb9032..5279bf50f 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.2.4 +// @version 1.2.5 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、千图网、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛 +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、千图网、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛... // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -23,6 +23,7 @@ // @match *://www.3dmgame.com/bagua/*.html // @match *://www.gamersky.com/ent/*/*.shtml // @match *://www.58pic.com/* +// @match *://rarbgprx.org/torrents.php* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -317,6 +318,17 @@ function: { before: _58pic_beforeFunction } + }, + rarbgprx: { + SiteTypeID: 23, + pager: { + type: 1, + nextLink: '(//a[@title="next page"])[1][@href]', + pageElement: 'css;table.lista2t tr.lista2', + HT_insert: ['css;table.lista2t > tbody', 3], + replaceE: 'css;#pager_links', + scrollDelta: 900 + } } }; @@ -414,6 +426,9 @@ curSite = DBSite._58pic_c; } break; + case "rarbgprx.org": + curSite = DBSite.rarbgprx; + break; } curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动无缝翻页 From 40f678c3410039966c640784a407c7c7c9233d55 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 17:23:33 +0800 Subject: [PATCH 0296/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[RARBG]=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Autopage.user.js b/Autopage.user.js index 5279bf50f..f17ebfd2e 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -2,7 +2,7 @@ // @name 自动无缝翻页 // @version 1.2.5 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、千图网、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛... +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、千图网、RARBG、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛... // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* From 97242c8a49a1e6596812cb517bacddc970590ac4 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 18:07:33 +0800 Subject: [PATCH 0297/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index b3c11a35e..6295a79af 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.9 +// @version 1.0.10 // @author X.I.U // @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -149,17 +149,23 @@ clearInterval(timer); // 取消定时器(每 10 毫秒一次的) setTimeout(function(){ // 为了避免太快 body 的 CSS 还没加载上,先延迟 100 毫秒(缺点就是可能会出现短暂一闪而过的暗黑滤镜) console.log('html:', window.getComputedStyle(document.lastChild).backgroundColor, 'body:', window.getComputedStyle(document.body).backgroundColor) + /*let rgbValueArry1 = window.getComputedStyle(document.body).backgroundColor.replace(/rgba|rgb|\(|\)| /g, '').split (','), + rgbValueArry2 = window.getComputedStyle(document.lastChild).backgroundColor.replace(/rgba|rgb|\(|\)| /g, '').split (','), + grayLevelBody = parseInt(rgbValueArry1[0]) + parseInt(rgbValueArry1[1]) + parseInt(rgbValueArry1[2]), + grayLevelHTML = parseInt(rgbValueArry2[0]) + parseInt(rgbValueArry2[1]) + parseInt(rgbValueArry2[2]); + console.log('html:', window.getComputedStyle(document.lastChild).backgroundColor, rgbValueArry2, grayLevelHTML, 'body:', window.getComputedStyle(document.body).backgroundColor, grayLevelBody)*/ + if (window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastChild).backgroundColor === 'rgba(0, 0, 0, 0)') { // 如果 body 没有 CSS 背景颜色,那就需要添加一个背景颜色,否则影响滤镜效果 document.lastChild.appendChild(document.createElement('style')).textContent = style_00; - } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor.replace(/rgb|rgba|\(|\)|,| /g, '') < 898989 || window.getComputedStyle(document.lastChild).backgroundColor.replace(/rgb|rgba|\(|\)|,| /g, '') < 898989) { + } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || window.getComputedStyle(document.body).backgroundColor != 'rgba(0, 0, 0, 0)' && parseInt(window.getComputedStyle(document.body).backgroundColor.replace(/rgba|rgb|\(|\)|,| /g, '')) < 898989 || window.getComputedStyle(document.lastChild).backgroundColor != 'rgba(0, 0, 0, 0)' && parseInt(window.getComputedStyle(document.lastChild).backgroundColor.replace(/rgba|rgb|\(|\)|,| /g, '')) < 898989) { // 如果是黑色 (等于0,0,0) 或深色 (小于 88,88,88),就停用本脚本滤镜 if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) console.log('检测到当前网页自带暗黑模式,停用本脚本滤镜...') document.getElementById('XIU2DarkMode').remove(); } } - }, 100); + }, 150); } }, 10); } From 58f3765961ca06ab05a5904df214a56e6ce2cad2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 18:10:23 +0800 Subject: [PATCH 0298/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 6295a79af..d1ea347a7 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -2,7 +2,7 @@ // @name 护眼模式 // @version 1.0.10 // @author X.I.U -// @description 最简单的全网通用护眼模式、夜间模式、暗黑模式 +// @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* // @exclude *://v.qq.com/* // @exclude *://*.iqiyi.com/* diff --git a/README.md b/README.md index ab5e4c69b..2eabc4b0f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| [](https://github.com/XIU2) | **护眼模式** | 最简单的全网通用护眼模式、夜间模式、暗黑模式 | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | +| [](https://github.com/XIU2) | **护眼模式** | 简单有效的全网通用护眼模式、夜间模式、暗黑模式 | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、链接转图片、自动无缝翻页、新标签页打开链接... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | From 3ab2ad892825e5182a4d02182c7559e3dfe33227 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 22 Jun 2021 21:56:36 +0800 Subject: [PATCH 0299/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 49 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index d1ea347a7..6d1ca54c2 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.0.10 +// @version 1.1.0 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -26,7 +26,7 @@ ['menu_runDuringTheDay', '白天保持开启 (比晚上亮一点点)', '白天保持开启', true], ['menu_autoRecognition', '排除自带暗黑模式的网页 (beta)', '排除自带暗黑模式的网页 (beta)', true], ['menu_darkModeType', '点击切换模式', '点击切换模式', 1] - ], menu_ID = []; + ], menu_ID = [], websiteList = ['rarbgprx.org','fitgirl-repacks.site','masquerade.site']; for (let i=0;i 0 && getColorValue(document.body) < 898989 || getColorValue(document.lastChild) > 0 && getColorValue(document.lastChild) < 898989) { + // 如果是黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) + for (let i=0;i 0 && getColorValue(document.body) < 898989 || getColorValue(document.lastChild) > 0 && getColorValue(document.lastChild) < 898989) { + // 如果是黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 + if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) + for (let i=0;i Date: Wed, 23 Jun 2021 09:14:22 +0800 Subject: [PATCH 0300/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E6=97=A5?= =?UTF-8?q?=E6=9C=AC=E4=B8=9C=E4=BA=AC]=20Raw=20=E5=8A=A0=E9=80=9F?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 53 +++++++++++++--------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index f3bf7c92f..7487bf8b2 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.5.2 +// @version 1.5.3 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -29,31 +29,34 @@ fontColor = '#b2b8bf'; } } -//['https://github.91chifun.workers.dev','美国'], +//['https://gh.66ccff.work', '美国'], +//['https://github.91chifun.workers.dev', '美国'], +//['https://github.rc1844.workers.dev', '美国'], var download_url = [ - ['https://gh.api.99988866.xyz','美国'], - ['https://gh.msx.workers.dev','美国'], - ['https://gh.xiu2.xyz','美国'], - ['https://gh.argv.cc','美国费利蒙'], - ['https://git.yumenaka.net','美国洛杉矶'], - ['https://download.fastgit.org','日本东京'], - ['https://ghproxy.com','韩国首尔'], - ['https://pd.zwc365.com/seturl','中国香港'] + ['https://gh.api.99988866.xyz', '美国'], + ['https://gh.msx.workers.dev', '美国'], + ['https://gh.xiu2.xyz', '美国'], + ['https://gh.argv.cc', '美国费利蒙'], + ['https://git.yumenaka.net', '美国洛杉矶'], + ['https://download.fastgit.org', '日本东京'], + ['https://ghproxy.com', '韩国首尔'], + ['https://pd.zwc365.com/seturl', '中国香港'] ], clone_url = [ - ['https://hub.fastgit.org','中国香港'], - ['https://gitclone.com','中国浙江'], - ['https://github.com.cnpmjs.org','新加坡'] + ['https://hub.fastgit.org', '中国香港'], + ['https://gitclone.com', '中国浙江'], + ['https://github.com.cnpmjs.org', '新加坡'] ], clone_ssh_url = [ - ['git@git.zhlh6.cn','中国北京'], - ['git@hub.fastgit.org','中国香港'] + ['git@git.zhlh6.cn', '中国北京'], + ['git@hub.fastgit.org', '中国香港'] ], raw_url = [ - ['https://raw.githubusercontent.com','Github 原生',''], - ['https://cdn.jsdelivr.net','中国国内','注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。'], - ['https://raw.fastgit.org','中国香港','注意:单个文件太大时可能会提示超时(实时获取中),请重试。'], - ['https://ghproxy.com','韩国首尔',''] + ['https://raw.githubusercontent.com', 'Github 原生',''], + ['https://cdn.jsdelivr.net','中国国内', '注意:该加速源存在缓存机制(24小时),所以文件可能不是最新。 注意:当前分支所有文件总文件大小超过 50MB 时,该加速源不可用。 注意:当前分支名为版本号格式时(如 v1.2.3),该高速下载链接因格式限制不可用。'], + ['https://raw.fastgit.org','中国香港', '注意:单个文件太大时可能会提示超时(实时获取中),请重试。'], + ['https://cdn.staticaly.com','日本东京', '注意:该加速是全球 Anycast CDN,国内一般分配到日本节点。'], + ['https://ghproxy.com','韩国首尔', ''] ], svg = [ '', @@ -251,11 +254,12 @@ url = [ raw_url[1][0] + "/gh" + href.replace('/blob/','@'), raw_url[2][0] + href2, - raw_url[3][0] + "/" + raw_url[0][0] + href2 + raw_url[3][0] + "/gh" + href.replace('/blob/','/'), + raw_url[4][0] + "/" + raw_url[0][0] + href2 ], _html = ``; for (let i=0;i${raw_url[i+1][1]}` + _html += `${raw_url[i+1][1]}` } html.insertAdjacentHTML('afterend', _html); } @@ -300,10 +304,15 @@ url_tip = raw_url[1][2]; break; case 3: - url = raw_url[3][0] + "/" + raw_url[0][0] + href2; + url = raw_url[3][0] + '/gh' + href.replace('/blob/','/'); url_name = raw_url[3][1]; url_tip = raw_url[3][2]; break; + case 4: + url = raw_url[4][0] + "/" + raw_url[0][0] + href2; + url_name = raw_url[4][1]; + url_tip = raw_url[4][2]; + break; default: url = raw_url[menu_raw_fast][0] + href2; url_name = raw_url[menu_raw_fast][1]; From 4d2bf9a7cdb421556c33edb95a1175261598bb55 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 23 Jun 2021 09:43:07 +0800 Subject: [PATCH 0301/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=B8=AA?= =?UTF-8?q?=E5=88=AB=E5=8A=A0=E8=BD=BD=E9=80=9F=E5=BA=A6=E5=A4=AA=E6=85=A2?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E7=AB=99=E6=B2=A1=E6=9C=89=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=BB=A4=E9=95=9C=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 6d1ca54c2..e28dc9a09 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.1.0 +// @version 1.1.1 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -141,7 +141,17 @@ break; } style_Add.id = 'XIU2DarkMode'; - document.lastChild.appendChild(style_Add).textContent = style; + //console.log(document,document.lastChild,document.querySelector('html')) + if (document.lastChild) { + document.lastChild.appendChild(style_Add).textContent = style; + } else { // 发现个别网站速度太慢的话,就会出现脚本运行太早,连 html 标签都还没加载。。。 + let timer1 = setInterval(function(){ // 每 5 毫秒检查一下 html 是否已存在 + if (document.lastChild) { + clearInterval(timer1); // 取消定时器 + document.lastChild.appendChild(style_Add).textContent = style; + } + }, 5); + } // 为了避免 body 还没加载导致无法检查是否设置背景颜色 let timer = setInterval(function(){ // 每 10 毫秒检查一下 body 是否已存在 From 97e3883c01a002b1d3ada5f6f0005deb568e761f Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 23 Jun 2021 09:54:46 +0800 Subject: [PATCH 0302/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=BC=82?= =?UTF-8?q?=E6=98=9F=E8=BD=AF=E4=BB=B6=E7=A9=BA=E9=97=B4]=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Autopage.user.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Autopage.user.js b/Autopage.user.js index f17ebfd2e..bfb05dac1 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 自动无缝翻页 -// @version 1.2.5 +// @version 1.2.6 // @author X.I.U -// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、豆瓣电影、3DM、游民星空、千图网、RARBG、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛... +// @description 自动无缝翻页,目前支持:423Down、Apphot、不死鸟、小众软件、异次元软件、微当下载、异星软件空间、豆瓣电影、3DM、游民星空、千图网、RARBG、FitGirl Repacks、AlphaCoders、PubMed、三国杀论坛、百分浏览器论坛... // @match *://www.423down.com/* // @exclude *://www.423down.com/*.html // @match *://apphot.cc/* @@ -24,6 +24,7 @@ // @match *://www.gamersky.com/ent/*/*.shtml // @match *://www.58pic.com/* // @match *://rarbgprx.org/torrents.php* +// @match *://www.yxssp.com/* // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand @@ -329,6 +330,17 @@ replaceE: 'css;#pager_links', scrollDelta: 900 } + }, + yxssp: { + SiteTypeID: 24, + pager: { + type: 1, + nextLink: '//div[@class="page-nav td-pb-padding-side"]/a[last()][@href]', + pageElement: 'css;.td-modules-container.td-module-number4 > div', + HT_insert: ['css;.td-modules-container.td-module-number4', 3], + replaceE: 'css;.page-nav.td-pb-padding-side', + scrollDelta: 900 + } } }; @@ -362,6 +374,9 @@ curSite = DBSite.weidown; } break; + case "www.yxssp.com": + curSite = DBSite.yxssp; + break; case "fitgirl-repacks.site": curSite = DBSite.fitgirl; break; From b5423340b01b9051823ef89147ca143162473dc7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:55:57 +0800 Subject: [PATCH 0303/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E9=A2=84=E8=A7=88=E5=B8=96=E5=AD=90=EF=BC=88=E5=B7=A6?= =?UTF-8?q?=E9=94=AE=E7=82=B9=E5=87=BB=E4=B8=A4=E4=BE=A7=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E5=A4=84=EF=BC=89]=20=E5=8A=9F=E8=83=BD=EF=BC=88=E6=AD=A3?= =?UTF-8?q?=E5=9C=A8=E6=A5=BC=E5=B1=82=E5=9B=9E=E5=A4=8D=E6=97=B6=E5=B0=86?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E6=94=B6=E8=B5=B7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 621ad4844..5ef6e02d6 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.2 +// @version 1.2.3 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* @@ -393,7 +393,7 @@ document.body.onclick = function(event){ if (event.target==this) { document.querySelectorAll('[id^="threadPreviewTR_"] .showhide').forEach(function (el) { - if (el.parentNode.querySelector('[name="message"]').value === '') { // 避免快速回复过程中误点收起了 + if (el.parentNode.querySelector('[name="message"]').value === '' && !document.getElementById('fwin_reply')) { // 避免快速回复过程中误点收起了 let parentElement = el.parentNode.parentNode.parentNode.parentNode.parentNode, top = parentElement.offsetTop + parentElement.offsetParent.offsetTop + parentElement.offsetParent.offsetParent.offsetTop; // 元素距离顶部的高度 if (top < document.documentElement.scrollTop) window.scrollTo(0,top) // 帖子标题在上面时才会滚动到该帖子处 From 711f0586d5bce74556f04eba805e839403767599 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 25 Jun 2021 13:01:09 +0800 Subject: [PATCH 0304/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 52pojie-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 3ce779915..2d1afc50a 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 吾爱破解论坛增强 - 自动签到、翻页 -// @version 1.2.8 +// @version 1.2.9 // @author X.I.U // @description 自动签到、自动无缝翻页、屏蔽导读悬赏贴(最新发表页) // @match *://www.52pojie.cn/* @@ -205,7 +205,7 @@ onload: function (response) { let html = ShowPager.createDocumentByString(response.responseText); html = html.querySelector('#messagetext p') - if (html && html.innerText.indexOf("任务已完成") > -1) { + if (html && html.innerText.indexOf('任务已完成') > -1 || html && html.innerText.indexOf('已申请过此任务') > -1) { qiandao.querySelector('.qq_bind').setAttribute('src','https://www.52pojie.cn/static/image/common/wbs.png') // 修改 [打卡签到] 图标为 [签到完毕] qiandao.href = "#" // 修改 URL 为 # } else { From 367da1c439cfdd0185d094b4cd848de444607b11 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 25 Jun 2021 19:45:56 +0800 Subject: [PATCH 0305/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=B8=A6=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BD=91=E9=A1=B5=20(beta)]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index e28dc9a09..bb4279e31 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.1.1 +// @version 1.1.2 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -164,7 +164,7 @@ let style_Add2 = document.createElement('style'); style_Add2.id = 'XIU2DarkMode2'; document.lastChild.appendChild(style_Add2).textContent = style_00; - } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || getColorValue(document.body) > 0 && getColorValue(document.body) < 898989 || getColorValue(document.lastChild) > 0 && getColorValue(document.lastChild) < 898989) { + } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(0, 0, 0)' || getColorValue(document.body) > 0 && getColorValue(document.body) < 898989 || getColorValue(document.lastChild) > 0 && getColorValue(document.lastChild) < 898989 || window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastChild).backgroundColor === 'rgb(0, 0, 0)') { // 如果是黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) for (let i=0;i 0 && getColorValue(document.body) < 898989 || getColorValue(document.lastChild) > 0 && getColorValue(document.lastChild) < 898989 || window.getComputedStyle(document.body).backgroundColor === 'rgba(0, 0, 0, 0)' && window.getComputedStyle(document.lastChild).backgroundColor === 'rgb(0, 0, 0)') { + // 如果是黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 + if (menu_value('menu_autoRecognition')) { // 排除自带暗黑模式的网页 (beta) + for (let i=0;i 0 && getColorValue(document.body) < 898989 || getColorValue(document.lastChild) > 0 && getColorValue(document.lastChild) < 898989) { // 如果是黑色 (等于0,0,0) 或深色 (小于 89,89,89),就停用本脚本滤镜 @@ -194,7 +211,7 @@ if (document.getElementById('XIU2DarkMode2')) document.getElementById('XIU2DarkMode2').remove(); } } - }, 3000); + }, 3000);*/ } // 获取背景颜色值 From d6374e16fd1c66b8ee7d3a40ff587c8d4d69682b Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 26 Jun 2021 13:13:18 +0800 Subject: [PATCH 0306/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5]=20=E6=88=91?= =?UTF-8?q?=E7=9A=84=E5=9B=9E=E5=A4=8D=E9=A1=B5=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 5ef6e02d6..411fb9e35 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.3 +// @version 1.2.4 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* @@ -122,6 +122,15 @@ HT_insert: ['css;div#threadlist', 2], replaceE: 'css;div.pg' } + }, + myreply: { + SiteTypeID: 4, + pager: { + nextLink: '(//a[@class="nxt"])[1][@href]', + pageElement: 'css;div#threadlist div.bm_c table > tbody', + HT_insert: ['css;div#threadlist div.bm_c table', 2], + replaceE: 'css;div.pg', + } } }; @@ -164,12 +173,15 @@ blockUsers('notice'); // 屏蔽用户(黑名单) } else if(location.pathname === '/home.php' && location.search === '?mod=space&do=pm') { // 消息(私人聊天) blockUsers('pm'); // 屏蔽用户(黑名单) + } else if(location.pathname === '/forum.php' && location.search === '?mod=guide&view=my&type=reply') { // 我的帖子:回复 + curSite = DBSite.myreply; } curSite.pageUrl = ""; // 下一页URL pageLoading(); // 自动翻页 if(menu_value('menu_backToTop'))backToTop(); // 回到顶部(右键点击左右两侧空白处) if(menu_value('menu_autoSignIn'))autoSignIn(); // 自动签到(访问空间 10 次 = 20 积分) + //replyIntervalDOMNodeInserted(); // 监听插入事件(回帖间隔) // 自动签到(访问空间 10 次 = 20 积分) @@ -327,6 +339,17 @@ } + // 监听插入事件(回帖间隔) + /*function replyIntervalDOMNodeInserted() { + let replyInterval = e => { + if (e.target.innerHTML && e.target.innerText.indexOf('发表回复 金钱+1') > -1) { + setTimeout(function () {GM_notification({text: '过去 60 秒了,可以回帖了~', timeout: 3500});}, 60000) + } + } + document.addEventListener('DOMNodeInserted', replyInterval); // 监听插入事件 + }*/ + + // 自动翻页 function pageLoading() { if (!menu_value('menu_pageLoading')) return From 046b80e17387245312cefe906d94163236788dee Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 27 Jun 2021 07:35:37 +0800 Subject: [PATCH 0307/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20[=E6=94=B6?= =?UTF-8?q?=E8=B5=B7=E9=A2=84=E8=A7=88=E5=B8=96=E5=AD=90=EF=BC=88=E5=B7=A6?= =?UTF-8?q?=E9=94=AE=E7=82=B9=E5=87=BB=E4=B8=A4=E4=BE=A7=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E5=A4=84=EF=BC=89]=20=E5=AF=B9=E5=B7=B2=E9=94=81=E5=AE=9A?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 411fb9e35..0f89b1486 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.4 +// @version 1.2.5 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* @@ -416,7 +416,7 @@ document.body.onclick = function(event){ if (event.target==this) { document.querySelectorAll('[id^="threadPreviewTR_"] .showhide').forEach(function (el) { - if (el.parentNode.querySelector('[name="message"]').value === '' && !document.getElementById('fwin_reply')) { // 避免快速回复过程中误点收起了 + if (!el.parentNode.querySelector('[name="message"]') || el.parentNode.querySelector('[name="message"]').value === '' && !document.getElementById('fwin_reply')) { // 避免快速回复过程中误点收起了 let parentElement = el.parentNode.parentNode.parentNode.parentNode.parentNode, top = parentElement.offsetTop + parentElement.offsetParent.offsetTop + parentElement.offsetParent.offsetParent.offsetTop; // 元素距离顶部的高度 if (top < document.documentElement.scrollTop) window.scrollTo(0,top) // 帖子标题在上面时才会滚动到该帖子处 From c12d9ee045b84addeaa87d8d60b82d848d3e9aa8 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 29 Jun 2021 18:14:52 +0800 Subject: [PATCH 0308/2377] =?UTF-8?q?=E9=80=82=E9=85=8D=20[=E4=B8=8E?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=90=8C=E6=AD=A5]=20=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E6=B7=B1=E8=89=B2=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 7487bf8b2..ba808dc3b 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.5.3 +// @version 1.5.4 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -20,18 +20,27 @@ (function() { var backColor = '#ffffff'; var fontColor = '#888888'; - if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') == 'dark') { // 黑暗模式判断 - if (document.getElementsByTagName('html')[0].getAttribute('data-dark-theme') == 'dark_dimmed') { + if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') === 'dark') { // 黑暗模式判断 + if (document.getElementsByTagName('html')[0].getAttribute('data-dark-theme') === 'dark_dimmed') { backColor = '#272e37'; fontColor = '#768390'; } else { backColor = '#161a21'; fontColor = '#b2b8bf'; } + } else if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') === 'auto') { + console.log(window.getComputedStyle(document.body).backgroundColor) + if (window.getComputedStyle(document.body).backgroundColor === 'rgb(34, 39, 46)') { + backColor = '#272e37'; + fontColor = '#768390'; + } else if (window.getComputedStyle(document.body).backgroundColor === 'rgb(13, 17, 23)') { + backColor = '#161a21'; + fontColor = '#b2b8bf'; + } } -//['https://gh.66ccff.work', '美国'], -//['https://github.91chifun.workers.dev', '美国'], -//['https://github.rc1844.workers.dev', '美国'], + //['https://gh.66ccff.work', '美国'], + //['https://github.91chifun.workers.dev', '美国'], + //['https://github.rc1844.workers.dev', '美国'], var download_url = [ ['https://gh.api.99988866.xyz', '美国'], ['https://gh.msx.workers.dev', '美国'], From a878f90077a2530cac1e9560e6e7ce8a7e41efb3 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 1 Jul 2021 14:29:13 +0800 Subject: [PATCH 0309/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0=EF=BC=88=E8=AE=BF=E9=97=AE=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=EF=BC=89]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 0f89b1486..f65a00bc8 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.5 +// @version 1.2.6 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* @@ -187,17 +187,18 @@ // 自动签到(访问空间 10 次 = 20 积分) function autoSignIn() { if (!loginStatus) return - if (GM_getValue('menu_signingIn')) return + //if (GM_getValue('menu_signingIn')) return let timeNow = new Date().getFullYear() + "/" + (new Date().getMonth() + 1) + "/" + new Date().getDate(), timeOld = GM_getValue('menu_signInTime'); if (!timeOld || timeOld != timeNow) { // 是新的一天 + GM_setValue('menu_signInTime', timeNow); // 写入签到时间以供后续比较 GM_notification({text: '请不要关闭/刷新本页!耐心等待 60 秒~\n在此期间可以在 "其他标签页" 浏览论坛!', timeout: 10000}); let url_list = [], url = 0; // 随机生成 12 个空间地址(2 个冗余) for(let i = 0;i < 12;i++){url_list[i] = "https://" + location.host + "/space-uid-" + Math.floor(Math.random()*(50000-10000+1)+10000) + ".html";} // 每 5 秒访问一次(避免触发网站防御机制) - GM_setValue('menu_signingIn', true); + //GM_setValue('menu_signingIn', true); let signIn = setInterval(function(){ GM_xmlhttpRequest({ url: url_list[url++], @@ -206,11 +207,11 @@ }); console.log(`[全球主机交流论坛 增强] 金钱 +2 (${url_list[url]})`); if (url === 11) { // 次数够了就取消定时循环 + clearInterval(signIn); + //GM_setValue('menu_signingIn', false); + //GM_setValue('menu_signInTime', timeNow); // 写入签到时间以供后续比较 console.log('[全球主机交流论坛 增强] 签到完成!'); GM_notification({text: '签到完成!金钱 +20 ~', timeout: 3500}); - GM_setValue('menu_signingIn', false); - GM_setValue('menu_signInTime', timeNow); // 写入签到时间以供后续比较 - clearInterval(signIn); } }, 5000); }/* else { // 新旧签到时间一致 @@ -221,7 +222,7 @@ // 重新签到 function reAutoSignIn() { - GM_setValue('menu_signingIn', false); + //GM_setValue('menu_signingIn', false); GM_setValue('menu_signInTime', '1970/1/1'); location.reload(); // 刷新网页 } From f203a1a30c805f283b5661368ebd93db12840c0a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 2 Jul 2021 23:01:32 +0800 Subject: [PATCH 0310/2377] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=9C=A8=20fast?= =?UTF-8?q?git=20=E9=95=9C=E5=83=8F=E7=AB=99=E6=97=B6=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=8A=A0=E9=80=9F=E6=BA=90=20URL=20=E6=9C=89=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GithubEnhanced-High-Speed-Download.user.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index ba808dc3b..280825532 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Github 增强 - 高速下载 -// @version 1.5.4 +// @version 1.5.5 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -143,7 +143,7 @@ } Array.from(html).forEach(function (current) { current.querySelectorAll('.d-flex.Box-body > a').forEach(function (_this) { - let href = _this.href.split('github.com'), + let href = _this.href.split(location.host), url = [], _html = `
    `; @@ -153,6 +153,7 @@ } else { url[i] = download_url[i][0] + '/' + _this.href } + if (location.host === 'hub.fastgit.org') url[i] = url[i].replace('hub.fastgit.org','github.com') } for (let i=0;i a').forEach(function (_this) { - let href = _this.href.split('github.com'), + let href = _this.href.split(location.host), url = [], _html = `
    `; @@ -177,6 +178,7 @@ } else { url[i] = download_url[i][0] + '/' + _this.href } + if (location.host === 'hub.fastgit.org') url[i] = url[i].replace('hub.fastgit.org','github.com') } for (let i=0;i Date: Wed, 7 Jul 2021 21:33:04 +0800 Subject: [PATCH 0311/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E7=94=A8=E6=88=B7=EF=BC=88=E9=BB=91=E5=90=8D=E5=8D=95?= =?UTF-8?q?=EF=BC=89]=20=E6=94=AF=E6=8C=81=E9=A2=84=E8=A7=88=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E4=B8=AD=E7=9A=84=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index f65a00bc8..1bac3f6b1 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.6 +// @version 1.2.7 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* @@ -99,7 +99,7 @@ thread: { SiteTypeID: 2, pager: { - nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]', + nextLink: '//a[@class="nxt"][@href]', pageElement: 'css;div#postlist > div[id^="post_"]', HT_insert: ['css;div#postlist', 2], replaceE: 'css;div.pg', @@ -108,7 +108,7 @@ guide: { SiteTypeID: 3, pager: { - nextLink: '//div[@id="pgt"]//a[contains(text(),"下一页")][@href]', + nextLink: '//a[@class="nxt"][@href]', pageElement: 'css;div#threadlist div.bm_c table > tbody[id^="normalthread_"]', HT_insert: ['css;div#threadlist div.bm_c table', 2], replaceE: 'css;div.pg', @@ -254,6 +254,7 @@ break; case 'forum': // 各版块帖子列表 blockUsers_('[id^="normalthread_"]', 'a[href^="space-uid"]'); + blockUsers_vfastpost(); // 预览帖子中的回复 break; case 'search': // 搜索结果 blockUsers_('.pbw', 'a[href^="space-uid"]'); @@ -279,6 +280,25 @@ }) }) } + + function blockUsers_vfastpost() { + let vfastpost = e => { + if (e.target.innerHTML && e.target.innerHTML.indexOf('id="vfastpost"') > -1) { + let listItem = e.target.querySelectorAll('[id^="post_"]'); + if (listItem.length < 1) return + listItem.forEach(function(item){ // 遍历所有回复 + menu_value('menu_customBlockUsers').forEach(function(item1){ // 遍历用户黑名单 + let itemName = item.querySelector('a.xi2'); // 寻找用户名 + if (itemName && itemName.innerText === item1) { + console.log(`屏蔽用户:${item1}`); + item.remove(); // 删除回复 + } + }) + }) + } + } + document.addEventListener('DOMNodeInserted', vfastpost); // 监听插入事件 + } } From 4eeed976cab6d6d5c98d611f0c3b03a79b0c3623 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 8 Jul 2021 22:09:02 +0800 Subject: [PATCH 0312/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Beautification.user.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 2c87cf87b..f044538a4 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎美化 -// @version 1.2.4 +// @version 1.2.5 // @author X.I.U // @description 宽屏显示、暗黑模式(4种)、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏、文章编辑页面与实际文章宽度一致、屏蔽登录提示 // @match *://www.zhihu.com/* @@ -281,13 +281,13 @@ html {filter: brightness(75%) sepia(30%) !important; background-image: url();} if (menu_value('menu_darkModeType') === 1) { if (getTheme() === 'light') { document.cookie="theme=dark; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/"; - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'dark'); + document.lastChild.setAttribute('data-theme', 'dark'); location.reload(); // 刷新网页 } } else { if (getTheme() === 'dark') { document.cookie="theme=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light'); + document.lastChild.setAttribute('data-theme', 'light'); location.reload(); // 刷新网页 } if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { @@ -313,7 +313,7 @@ html {filter: brightness(75%) sepia(30%) !important; background-image: url();} } else { if (getTheme() === 'dark'){ document.cookie="theme=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; - document.getElementsByTagName('html')[0].setAttribute('data-theme', 'light'); + document.lastChild.setAttribute('data-theme', 'light'); location.reload(); // 刷新网页 } } @@ -345,7 +345,7 @@ html {filter: brightness(75%) sepia(30%) !important; background-image: url();} } } - style_Add.innerHTML = style; + /*style_Add.innerHTML = style; if (document.head) { document.head.appendChild(style_Add); } else { @@ -355,6 +355,17 @@ html {filter: brightness(75%) sepia(30%) !important; background-image: url();} clearInterval(timer); } }, 1); + }*/ + + if (document.lastChild) { + document.lastChild.appendChild(style_Add).textContent = style; + } else { // 避免网站加载速度太慢的备用措施 + let timer1 = setInterval(function(){ // 每 5 毫秒检查一下 html 是否已存在 + if (document.lastChild) { + clearInterval(timer1); // 取消定时器 + document.lastChild.appendChild(style_Add).textContent = style; + } + }, 5); } } function getTheme() { From 10c35bc4610ce2eb093120d67666aa1e1c0a07fb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 8 Jul 2021 23:22:09 +0800 Subject: [PATCH 0313/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index bb4279e31..8f6a3bad0 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.1.2 +// @version 1.1.3 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -26,7 +26,7 @@ ['menu_runDuringTheDay', '白天保持开启 (比晚上亮一点点)', '白天保持开启', true], ['menu_autoRecognition', '排除自带暗黑模式的网页 (beta)', '排除自带暗黑模式的网页 (beta)', true], ['menu_darkModeType', '点击切换模式', '点击切换模式', 1] - ], menu_ID = [], websiteList = ['rarbgprx.org','fitgirl-repacks.site','masquerade.site']; + ], menu_ID = [], websiteList = ['rarbgprx.org','fitgirl-repacks.site','masquerade.site','www.gamersky.com']; for (let i=0;i -1) { @@ -141,6 +141,7 @@ break; } style_Add.id = 'XIU2DarkMode'; + style_Add.type = 'text/css'; //console.log(document,document.lastChild,document.querySelector('html')) if (document.lastChild) { document.lastChild.appendChild(style_Add).textContent = style; @@ -212,6 +213,16 @@ } } }, 3000);*/ + + // 解决远景论坛会清理掉前面插入的 CSS 样式的问题 + if (location.hostname === 'bbs.pcbeta.com') { + let timer1 = setInterval(function(){ + if (!document.getElementById('XIU2DarkMode')) { + document.lastChild.appendChild(style_Add).textContent = style; + clearInterval(timer1); + } + }, 10); + } } // 获取背景颜色值 From 805657555234e8f3ce710f5b1ba7b0e75a83dbbb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 10 Jul 2021 01:17:29 +0800 Subject: [PATCH 0314/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=9B=9E?= =?UTF-8?q?=E5=B8=96=E5=B0=8F=E5=B0=BE=E5=B7=B4]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 66 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 1bac3f6b1..841ef4ba7 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.7 +// @version 1.2.8 // @author X.I.U -// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 +// @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、回帖小尾巴、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* // @match *://91ai.net/* // @icon https://www.hostloc.com/favicon.ico @@ -26,6 +26,7 @@ ['menu_customBlockUsers', '自定义屏蔽用户', '自定义屏蔽用户', []], ['menu_blockKeywords', '屏蔽关键词(帖子标题)', '屏蔽关键词(帖子标题)', false], ['menu_customBlockKeywords', '自定义屏蔽关键词', '自定义屏蔽关键词', []], + ['menu_customLittleTail', '自定义小尾巴内容', '自定义小尾巴内容', []], ['menu_pageLoading', '自动无缝翻页(总开关)', '自动无缝翻页', true], ['menu_thread_pageLoading', '帖子内自动翻页', '帖子内自动翻页', true], ['menu_backToTop', '快捷回到顶部(右键点击两侧空白处)', '快捷回到顶部', true], @@ -54,6 +55,8 @@ menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){customBlockUsers()}); } else if (menu_ALL[i][0] === 'menu_customBlockKeywords') { menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){customBlockKeywords()}); + } else if (menu_ALL[i][0] === 'menu_customLittleTail') { + menu_ID[i] = GM_registerMenuCommand(`[ ⚑ ] ${menu_ALL[i][1]}`, function(){customLittleTail()}); } else { menu_ID[i] = GM_registerMenuCommand(`[ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } @@ -156,6 +159,7 @@ showPosts(); // 自动显示帖子内被隐藏的回复 blockUsers('thread'); // 屏蔽用户(黑名单) if (menu_value('menu_onlineStatus')) onlineStatus(); // 显示是否在线 + littleTail('thread'); // 小尾巴 } else if (patt_forum.test(location.pathname) || location.search.indexOf('mod=forumdisplay') > -1) { // 各板块帖子列表 curSite = DBSite.forum; if (menu_value('menu_collapsedNowPost')) collapsedNowPost(); // 收起当前帖子预览(左键左右两侧空白处) @@ -163,6 +167,7 @@ blockUsers('forum'); // 屏蔽用户(黑名单) blockKeywords(); // 屏蔽关键词(帖子标题) vfastpostDOMNodeInserted(); // 监听插入事件(预览快速回复带签名) + littleTail('forum'); // 小尾巴 if (patt_forum.test(location.pathname)) blockDOMNodeInserted(); //监听插入事件(有新的回复主题,点击查看) }else if (patt_guide.test(location.search)) { // 导读帖子列表 curSite = DBSite.guide; @@ -171,10 +176,12 @@ blockUsers('search'); // 屏蔽用户(黑名单) } else if(location.pathname === '/home.php' && location.search.indexOf('mod=space&do=notice&view=mypost') > -1) { // 消息(帖子/点评/提到) blockUsers('notice'); // 屏蔽用户(黑名单) - } else if(location.pathname === '/home.php' && location.search === '?mod=space&do=pm') { // 消息(私人聊天) + } else if(location.pathname === '/home.php' && location.search.indexOf('mod=space&do=pm') > -1) { // 消息(私人聊天) blockUsers('pm'); // 屏蔽用户(黑名单) - } else if(location.pathname === '/forum.php' && location.search === '?mod=guide&view=my&type=reply') { // 我的帖子:回复 + } else if(location.pathname === '/forum.php' && location.search.indexOf('mod=guide&view=my&type=reply') > -1) { // 我的帖子:回复 curSite = DBSite.myreply; + } else if(location.pathname === '/forum.php' && location.search.indexOf('mod=post&action=reply') > -1) { // 回复:高级回复 + littleTail('reply'); // 小尾巴 } curSite.pageUrl = ""; // 下一页URL @@ -360,6 +367,57 @@ } + // 自定义小尾巴内容 + function customLittleTail() { + let newLittleTail = prompt('编辑 [自定义小尾巴内容],刷新网页后生效\n(换行请使用 \\n 例如:我是第一行~\\n我是第二行~', GM_getValue('menu_customLittleTail')); + if (newLittleTail === '') { + GM_setValue('menu_customLittleTail', []); + registerMenuCommand(); // 重新注册脚本菜单 + } else if (newLittleTail != null) { + GM_setValue('menu_customLittleTail', newLittleTail); + registerMenuCommand(); // 重新注册脚本菜单 + } + }; + + + // 小尾巴 + function littleTail(type) { + if (!menu_value('menu_customLittleTail')) return + switch(type) { + case 'forum': // 各版块帖子列表的预览帖子 + littleTail_1(); + break; + case 'thread': // 帖子内 + littleTail_1(); + littleTail_2(); + break; + case 'reply': // 高级回复 + littleTail_3(); + break; + } + + function littleTail_1() { + let floatlayout_reply = e => { + if (e.target.innerHTML && e.target.innerHTML.indexOf('id="floatlayout_reply"') > -1) { + document.getElementById('postsubmit').onclick = function(){document.getElementById('postmessage').value += GM_getValue('menu_customLittleTail').replaceAll('\\n', '\n');} + } + } + document.addEventListener('DOMNodeInserted', floatlayout_reply); // 监听插入事件 + } + + function littleTail_2() { // 帖子底部的回复框 + document.getElementById('fastpostsubmit').onclick = function(){document.getElementById('fastpostmessage').value += GM_getValue('menu_customLittleTail').replaceAll('\\n', '\n');} + } + + function littleTail_3() { + let postsubmit = document.getElementById('postsubmit'); + if (postsubmit && postsubmit.innerText === '\n参与/回复主题\n') { + postsubmit.onclick = function(){document.getElementById('e_textarea').value += GM_getValue('menu_customLittleTail').replaceAll('\\n', '\n');} + } + } + } + + // 监听插入事件(回帖间隔) /*function replyIntervalDOMNodeInserted() { let replyInterval = e => { From 05057585689173c9b88140d566ac25496c1061d6 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 10 Jul 2021 01:25:11 +0800 Subject: [PATCH 0315/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=9B=9E?= =?UTF-8?q?=E5=B8=96=E5=B0=8F=E5=B0=BE=E5=B7=B4]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 841ef4ba7..6bf07a489 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -180,7 +180,7 @@ blockUsers('pm'); // 屏蔽用户(黑名单) } else if(location.pathname === '/forum.php' && location.search.indexOf('mod=guide&view=my&type=reply') > -1) { // 我的帖子:回复 curSite = DBSite.myreply; - } else if(location.pathname === '/forum.php' && location.search.indexOf('mod=post&action=reply') > -1) { // 回复:高级回复 + } else if(location.pathname === '/forum.php' && location.search.indexOf('mod=post&action=reply') > -1 || location.pathname === '/forum.php' && location.search.indexOf('mod=post&action=newthread') > -1) { // 回复:高级回复 littleTail('reply'); // 小尾巴 } @@ -411,7 +411,7 @@ function littleTail_3() { let postsubmit = document.getElementById('postsubmit'); - if (postsubmit && postsubmit.innerText === '\n参与/回复主题\n') { + if (postsubmit && postsubmit.innerText === '\n参与/回复主题\n' || postsubmit && postsubmit.innerText === '\n发表帖子\n') { postsubmit.onclick = function(){document.getElementById('e_textarea').value += GM_getValue('menu_customLittleTail').replaceAll('\\n', '\n');} } } From 9d68b6576c42108cb93370c1a013f399d678a9cb Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 10 Jul 2021 10:00:56 +0800 Subject: [PATCH 0316/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=9B=9E?= =?UTF-8?q?=E5=B8=96=E5=B0=8F=E5=B0=BE=E5=B7=B4]=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=B8=96=E5=AD=90=E5=BA=95=E9=83=A8=E7=9A=84?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 6bf07a489..d3d9cf03c 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.8 +// @version 1.2.9 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、回帖小尾巴、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* @@ -369,7 +369,7 @@ // 自定义小尾巴内容 function customLittleTail() { - let newLittleTail = prompt('编辑 [自定义小尾巴内容],刷新网页后生效\n(换行请使用 \\n 例如:我是第一行~\\n我是第二行~', GM_getValue('menu_customLittleTail')); + let newLittleTail = prompt('编辑 [自定义小尾巴内容],刷新网页后生效(换行请使用 \\n\n提示①:记得在小尾巴前面加上几个 \\n 换行,用来分隔开回帖内容~\n提示②:建议使用 [align=right] 标签来使小尾巴居右~\n提示③:支持论坛富文本标签(建议先找个回复编辑预览好~\n示例:\\n\\n\\n\\n[align=right]第一行内容~\\n第二行内容~[/align]', GM_getValue('menu_customLittleTail')); if (newLittleTail === '') { GM_setValue('menu_customLittleTail', []); registerMenuCommand(); // 重新注册脚本菜单 @@ -385,17 +385,29 @@ if (!menu_value('menu_customLittleTail')) return switch(type) { case 'forum': // 各版块帖子列表的预览帖子 - littleTail_1(); + littleTail_0(); // 预览帖子 快速回复(底部) + littleTail_1(); // 预览帖子 回复(悬浮) break; case 'thread': // 帖子内 - littleTail_1(); - littleTail_2(); + littleTail_1(); // 快速回复(悬浮) + littleTail_2(); // 回复框(底部) break; case 'reply': // 高级回复 littleTail_3(); break; } + function littleTail_0() { + let vfastpost = e => { + if (e.target.innerHTML && e.target.innerHTML.indexOf('id="vfastpost"') > -1) { + let message = e.target.querySelector('input[name="message"]'), id = message.id.match(/\d+/g)[0]; + message.parentNode.innerHTML = `` + document.getElementById(`vreplysubmit_${id}`).onclick = function(){document.getElementById(`vmessage_${id}`).value += GM_getValue('menu_customLittleTail').replaceAll('\\n', '\n');} + } + } + document.addEventListener('DOMNodeInserted', vfastpost); // 监听插入事件 + } + function littleTail_1() { let floatlayout_reply = e => { if (e.target.innerHTML && e.target.innerHTML.indexOf('id="floatlayout_reply"') > -1) { From 660d7b2fc65d031d8f83c6778f097a4a4fbeca20 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sun, 11 Jul 2021 13:41:39 +0800 Subject: [PATCH 0317/2377] README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2eabc4b0f..a7163ce06 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ | | 脚本名称 | 脚本功能 | 安装 \| 备用 | | :----: | :---- | :---- | :----: | -| [](https://github.com/XIU2) | **护眼模式** | 简单有效的全网通用护眼模式、夜间模式、暗黑模式 | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | +| [](https://github.com/XIU2) | **护眼模式** | 简单有效的全网通用护眼模式、夜间模式、暗黑模式~ | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/DarkMode.user.js)** | | [](https://www.zhihu.com/people/xiu2) | **知乎 美化** | 宽屏显示、**暗黑模式**、隐藏文章开头大图、调整图片最大高... | **[安装](https://greasyfork.org/zh-CN/scripts/412212)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Beautification.user.js)** | -| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽指定用户、屏蔽盐选内... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | +| [](https://www.zhihu.com/people/xiu2) | **知乎 增强** | **移除登录弹窗**、一键收起回答、屏蔽用户、屏蔽关键词(标题)... | **[安装](https://greasyfork.org/zh-CN/scripts/419081)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhihu-Enhanced.user.js)** | | [](https://www.v2ex.com/) | **V2ex 增强** | **自动签到**、链接转图片、自动无缝翻页、新标签页打开链接... | **[安装](https://greasyfork.org/zh-CN/scripts/424246)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/V2ex-Enhanced.user.js)** | | [](https://github.com/XIU2) | **Github 增强** | **高速下载** Git Clone/SSH、Release、Raw、Code(ZIP) 文件... | **[安装](https://greasyfork.org/zh-CN/scripts/412245)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** | | [](https://github.com/XIU2) | **自动无缝翻页 \*** | 423Down、Apphot、不死鸟、小众软件、异次元软件... | **[安装](https://greasyfork.org/zh-CN/scripts/419215)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Autopage.user.js)** | @@ -27,11 +27,11 @@ | [](https://bbs.3dmgame.com) | **3DM论坛 增强** | **自动回复**、自动无缝翻页、清理置顶帖子、自动滚动至隐藏... | **[安装](https://greasyfork.org/zh-CN/scripts/412890)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 美化** | 精简多余内容、样式优化、宽屏显示 | **[安装](https://greasyfork.org/zh-CN/scripts/412361)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** | | [](http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline) | **智友邦论坛 增强** | 自动签到、**自动回复**、自动无缝翻页、快捷回到顶部、附件... | **[安装](https://greasyfork.org/zh-CN/scripts/412362)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** | -| [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、后退返回上一级、**右键显示菜单**、自动显... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | +| [](https://www.lanzou.com) | **蓝奏云网盘 增强 \*** | 刷新不回根目录、**右键显示菜单**、自动显示更多文件、自动... | **[安装](https://greasyfork.org/zh-CN/scripts/419224)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** | | [](https://translate.google.cn) | ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[安装](https://zhuanlan.zhihu.com/p/286815739)** \| **[备用](https://zhuanlan.zhihu.com/p/286815739)**_~~ | | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | **自动签到**、自动无缝翻页、屏蔽导读悬赏贴 (最新发表页)... | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | -| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动签到 (访问空间)、屏蔽指定用户**、自动无缝翻页等... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | +| [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动访问空间、屏蔽用户**、屏蔽关键词、自动无缝翻页等... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | | [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ From 9ca2977d15b1bb0002f4375e3652e6a3f90c25e0 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 15 Jul 2021 09:09:45 +0800 Subject: [PATCH 0318/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=A8=A1=E5=BC=8F=E9=A2=9C=E8=89=B2]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 66 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 8f6a3bad0..3f63a4baa 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.1.3 +// @version 1.1.4 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -25,7 +25,10 @@ var menu_ALL = [ ['menu_runDuringTheDay', '白天保持开启 (比晚上亮一点点)', '白天保持开启', true], ['menu_autoRecognition', '排除自带暗黑模式的网页 (beta)', '排除自带暗黑模式的网页 (beta)', true], - ['menu_darkModeType', '点击切换模式', '点击切换模式', 1] + ['menu_darkModeType', '点击切换模式', '点击切换模式', 1], + ['menu_customMode1', '自定义模式 1', '自定义模式 1', '80|70'], + ['menu_customMode2', '自定义模式 2', '自定义模式 2', '80|20|70|30'], + ['menu_customMode3', '自定义模式 3', '自定义模式 3', '80'] ], menu_ID = [], websiteList = ['rarbgprx.org','fitgirl-repacks.site','masquerade.site','www.gamersky.com']; for (let i=0;i -1) { From a9cccc58b6098c1918ea6860bfb5951c64cde8ee Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 15 Jul 2021 16:32:02 +0800 Subject: [PATCH 0319/2377] =?UTF-8?q?=E5=90=88=E5=B9=B6=203=E4=B8=AA=20[?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A8=A1=E5=BC=8F]=20=E4=B8=BA=20[?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=BD=93=E5=89=8D=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD;=20=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=BD=93=E5=89=8D=E6=A8=A1=E5=BC=8F]=20?= =?UTF-8?q?=E5=90=8E=E7=AB=8B=E5=8D=B3=E7=94=9F=E6=95=88~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 51 +++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 3f63a4baa..8d80d555a 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.1.4 +// @version 1.1.5 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -26,6 +26,7 @@ ['menu_runDuringTheDay', '白天保持开启 (比晚上亮一点点)', '白天保持开启', true], ['menu_autoRecognition', '排除自带暗黑模式的网页 (beta)', '排除自带暗黑模式的网页 (beta)', true], ['menu_darkModeType', '点击切换模式', '点击切换模式', 1], + ['menu_customMode', '自定义当前模式', '自定义当前模式', '80|70'], ['menu_customMode1', '自定义模式 1', '自定义模式 1', '80|70'], ['menu_customMode2', '自定义模式 2', '自定义模式 2', '80|20|70|30'], ['menu_customMode3', '自定义模式 3', '自定义模式 3', '80'] @@ -52,15 +53,15 @@ GM_setValue('menu_darkModeType', menu_ALL[i][3]); } menu_ID[i] = GM_registerMenuCommand(`🔄 [ ${menu_ALL[i][3]} ] ${menu_ALL[i][1]}`, function(){menu_toggle(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`)}); + } else if (menu_ALL[i][0] === 'menu_customMode') { + GM_setValue('menu_customMode', menu_ALL[i][3]); + menu_ID[i] = GM_registerMenuCommand(`✅ ${menu_ALL[i][1]}`, function(){menu_customMode()}); } else if (menu_ALL[i][0] === 'menu_customMode1') { GM_setValue('menu_customMode1', menu_ALL[i][3]); - menu_ID[i] = GM_registerMenuCommand(`1️⃣ ${menu_ALL[i][1]}`, function(){menu_customMode(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`)}); } else if (menu_ALL[i][0] === 'menu_customMode2') { GM_setValue('menu_customMode2', menu_ALL[i][3]); - menu_ID[i] = GM_registerMenuCommand(`2️⃣ ${menu_ALL[i][1]}`, function(){menu_customMode(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`)}); } else if (menu_ALL[i][0] === 'menu_customMode3') { GM_setValue('menu_customMode3', menu_ALL[i][3]); - menu_ID[i] = GM_registerMenuCommand(`3️⃣ ${menu_ALL[i][1]}`, function(){menu_customMode(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`)}); } else { menu_ID[i] = GM_registerMenuCommand(`🌝 [ ${menu_ALL[i][3]?'√':'×'} ] ${menu_ALL[i][1]}`, function(){menu_switch(`${menu_ALL[i][3]}`,`${menu_ALL[i][0]}`,`${menu_ALL[i][2]}`)}); } @@ -69,30 +70,36 @@ } - function menu_customMode(menu_status, Name) { - let newMods, tip, defaults; - switch(Name) { - case 'menu_customMode1': - tip = '自定义 [模式 1],刷新网页后生效~\n格式:亮度 (白天)|亮度 (晚上)\n默认:80|70(均为百分比 1~100,不需要 % 符号)' - defaults = '80|70' + // 自定义当前模式 + function menu_customMode() { + let newMods, tip, defaults, name; + switch(menu_value('menu_darkModeType')) { + case 1: + tip = '自定义 [模式 1],修改后立即生效~\n格式:亮度 (白天)|亮度 (晚上)\n默认:80|70(均为百分比 1~100,不需要 % 符号)'; + defaults = '80|70'; + name = 'menu_customMode1'; break; - case 'menu_customMode2': - tip = '自定义 [模式 2],刷新网页后生效~\n格式:亮度 (白天)|暖色 (白天)|亮度 (晚上)|暖色 (晚上)\n默认:80|20|70|30(均为百分比 1~100,不需要 % 符号)' - defaults = '80|20|70|30' + case 2: + tip = '自定义 [模式 2],修改后立即生效~\n格式:亮度 (白天)|暖色 (白天)|亮度 (晚上)|暖色 (晚上)\n默认:80|20|70|30(均为百分比 1~100,不需要 % 符号)'; + defaults = '80|20|70|30'; + name = 'menu_customMode2'; break; - case 'menu_customMode3': - tip = '自定义 [模式 3],刷新网页后生效~\n格式:反色\n默认:80(均为百分比 50~100,不需要 % 符号)' - defaults = '80' + case 3: + tip = '自定义 [模式 3],修改后立即生效~\n格式:反色\n默认:80(均为百分比 50~100,不需要 % 符号)'; + defaults = '80'; + name = 'menu_customMode3'; break; } - newMods = prompt(tip, GM_getValue(`${Name}`)); + newMods = prompt(tip, GM_getValue(`${name}`)); if (newMods === '') { - GM_setValue(`${Name}`, defaults); + GM_setValue(`${name}`, defaults); registerMenuCommand(); // 重新注册脚本菜单 } else if (newMods != null) { - GM_setValue(`${Name}`, newMods); + GM_setValue(`${name}`, newMods); registerMenuCommand(); // 重新注册脚本菜单 } + document.getElementById('XIU2DarkMode').remove(); // 即时修改样式 + addStyle(); } @@ -136,9 +143,9 @@ function addStyle() { let remove = false, style_Add = document.createElement('style'), hours = new Date().getHours(), - style_10 = GM_getValue('menu_customMode1').split('|'), - style_20 = GM_getValue('menu_customMode2').split('|'), - style_30 = GM_getValue('menu_customMode3').split('|'), + style_10 = menu_value('menu_customMode1').split('|'), + style_20 = menu_value('menu_customMode2').split('|'), + style_30 = menu_value('menu_customMode3').split('|'), style = ``, style_00 = `html, body {background-color: #ffffff;}`, style_11 = `html {filter: brightness(${style_10[0]}%) !important;}`, From 34961430e2e166f5670a060999a9a2413185f658 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 15 Jul 2021 16:45:57 +0800 Subject: [PATCH 0320/2377] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=BD=93=E5=89=8D=E6=A8=A1=E5=BC=8F]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 8d80d555a..212c5d96b 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.1.5 +// @version 1.1.6 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -75,17 +75,17 @@ let newMods, tip, defaults, name; switch(menu_value('menu_darkModeType')) { case 1: - tip = '自定义 [模式 1],修改后立即生效~\n格式:亮度 (白天)|亮度 (晚上)\n默认:80|70(均为百分比 1~100,不需要 % 符号)'; + tip = '自定义 [模式 1],修改后立即生效 (部分网页可能需要刷新)~\n格式:亮度 (白天)|亮度 (晚上)\n默认:80|70(均为百分比 1~100,不需要 % 符号)'; defaults = '80|70'; name = 'menu_customMode1'; break; case 2: - tip = '自定义 [模式 2],修改后立即生效~\n格式:亮度 (白天)|暖色 (白天)|亮度 (晚上)|暖色 (晚上)\n默认:80|20|70|30(均为百分比 1~100,不需要 % 符号)'; + tip = '自定义 [模式 2],修改后立即生效 (部分网页可能需要刷新)~\n格式:亮度 (白天)|暖色 (白天)|亮度 (晚上)|暖色 (晚上)\n默认:80|20|70|30(均为百分比 1~100,不需要 % 符号)'; defaults = '80|20|70|30'; name = 'menu_customMode2'; break; case 3: - tip = '自定义 [模式 3],修改后立即生效~\n格式:反色\n默认:80(均为百分比 50~100,不需要 % 符号)'; + tip = '自定义 [模式 3],修改后立即生效 (部分网页可能需要刷新)~\n格式:反色\n默认:80(均为百分比 50~100,不需要 % 符号)'; defaults = '80'; name = 'menu_customMode3'; break; @@ -98,8 +98,10 @@ GM_setValue(`${name}`, newMods); registerMenuCommand(); // 重新注册脚本菜单 } - document.getElementById('XIU2DarkMode').remove(); // 即时修改样式 - addStyle(); + if (document.getElementById('XIU2DarkMode')) { + document.getElementById('XIU2DarkMode').remove(); // 即时修改样式 + addStyle(); + } } From 43084d1a7684e7bda4a61dc4a03ded8abe8d566d Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 16 Jul 2021 15:02:26 +0800 Subject: [PATCH 0321/2377] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a7163ce06..4bdb4f06b 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ | [](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** | | [](https://www.52pojie.cn) | **吾爱破解论坛 增强** | **自动签到**、自动无缝翻页、屏蔽导读悬赏贴 (最新发表页)... | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** | | [](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动访问空间、屏蔽用户**、屏蔽关键词、自动无缝翻页等... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Hostloc-Enhanced.user.js)** | -| [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://greasyfork.org/zh-CN/scripts/397666)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | +| [](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://github.com/XIU2/UserScript/raw/master/SteamWorkshopImageRepair.user.js)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** | > _脚本名称末尾 **`*`** 代表该脚本为**网友主动提出需求**而写的。如果你也有需求,可以[告诉我](https://github.com/XIU2/UserScript/issues/new/choose)!_ > _所有脚本均在 **Chrome、Firefox、Edge 浏览器 + Tampermonkey 扩展** 环境下测试通过!_ From 35fc4232ff8afaa0f7fbdadfa846cb037efd2cad Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 17 Jul 2021 06:32:47 +0800 Subject: [PATCH 0322/2377] Update --- SteamWorkshopImageRepair.user.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/SteamWorkshopImageRepair.user.js b/SteamWorkshopImageRepair.user.js index 949acfa4b..5188fa9aa 100644 --- a/SteamWorkshopImageRepair.user.js +++ b/SteamWorkshopImageRepair.user.js @@ -1,16 +1,14 @@ // ==UserScript== -// @name Steam Workshop Image Repair -// @name:zh-CN Steam 创意工坊大图修复 -// @version 1.0.0 -// @author X.I.U -// @description Fixed Steam Workshop image not showing -// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题(Steam 不改的话,长期可用) -// @match *://steamcommunity.com/sharedfiles/filedetails/* -// @match *://steamcommunity.com/workshop/filedetails/* -// @icon https://store.steampowered.com/favicon.ico -// @license GPL-3.0 License -// @run-at document-end -// @namespace https://greasyfork.org/scripts/397666 +// @name Steam 创意工坊大图修复 +// @version 1.0.0 +// @author X.I.U +// @description 修复 Steam 创意工坊预览大图无法显示的问题(Steam 不改的话,长期可用) +// @match *://steamcommunity.com/sharedfiles/filedetails/* +// @match *://steamcommunity.com/workshop/filedetails/* +// @icon https://store.steampowered.com/favicon.ico +// @license GPL-3.0 License +// @run-at document-end +// @namespace https://github.com/XIU2/UserScript // ==/UserScript== if(typeof onYouTubeIframeAPIReady == 'function') { From 2fe4267aa6a95dfa41736b19865ff4b79189ea17 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 17 Jul 2021 07:09:11 +0800 Subject: [PATCH 0323/2377] =?UTF-8?q?=E8=A1=A5=E5=85=85=20=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=A4=B4=E9=83=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Beautification.user.js | 2 ++ 3dm-Enhanced.user.js | 2 ++ 52pojie-Beautification.user.js | 2 ++ 52pojie-Enhanced.user.js | 2 ++ Autopage.user.js | 2 ++ DarkMode.user.js | 2 ++ GithubEnhanced-High-Speed-Download.user.js | 2 ++ GoogleTranslate-Beautification.user.js | 2 ++ Hostloc-Enhanced.user.js | 2 ++ Lanzou-Enhanced.user.js | 2 ++ SteamWorkshopImageRepair.user.js | 2 ++ V2ex-Enhanced.user.js | 2 ++ Zhihu-Beautification.user.js | 2 ++ Zhihu-Enhanced.user.js | 2 ++ Zhiyoo-Beautification.user.js | 2 ++ Zhiyoo-Enhanced.user.js | 2 ++ 16 files changed, 32 insertions(+) diff --git a/3dm-Beautification.user.js b/3dm-Beautification.user.js index fc451aa0b..b61ba0d08 100644 --- a/3dm-Beautification.user.js +++ b/3dm-Beautification.user.js @@ -8,6 +8,8 @@ // @license GPL-3.0 License // @run-at document-start // @namespace https://greasyfork.org/scripts/413593 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index c1f5ad0da..f76651817 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -15,6 +15,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412890 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index 2962f6a9b..e474782ab 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -14,6 +14,8 @@ // @license GPL-3.0 License // @run-at document-start // @namespace https://greasyfork.org/scripts/412681 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index 2d1afc50a..f6481eaff 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -15,6 +15,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412680 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/Autopage.user.js b/Autopage.user.js index bfb05dac1..d29e3f10a 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -32,6 +32,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://github.com/XIU2/UserScript +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/DarkMode.user.js b/DarkMode.user.js index 212c5d96b..51749f44c 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -19,6 +19,8 @@ // @license GPL-3.0 License // @run-at document-start // @namespace https://github.com/XIU2/UserScript +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 280825532..6a59cd7af 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -15,6 +15,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412245 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/GoogleTranslate-Beautification.user.js b/GoogleTranslate-Beautification.user.js index 9fec41fe3..bcf84f370 100644 --- a/GoogleTranslate-Beautification.user.js +++ b/GoogleTranslate-Beautification.user.js @@ -15,6 +15,8 @@ // @license GPL-3.0 License // @run-at document-start // @namespace https://greasyfork.org/scripts/413721 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index d3d9cf03c..f73a824ab 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -16,6 +16,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/414005 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index c95f5d8ab..f18cb8db8 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -27,6 +27,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://github.com/XIU2/UserScript +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { var menu_ALL = [ diff --git a/SteamWorkshopImageRepair.user.js b/SteamWorkshopImageRepair.user.js index 5188fa9aa..34498abdd 100644 --- a/SteamWorkshopImageRepair.user.js +++ b/SteamWorkshopImageRepair.user.js @@ -9,6 +9,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://github.com/XIU2/UserScript +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== if(typeof onYouTubeIframeAPIReady == 'function') { diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index d0a691178..e5d3ae5ee 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -16,6 +16,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://github.com/XIU2/UserScript +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index f044538a4..25ee455f7 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -15,6 +15,8 @@ // @license GPL-3.0 License // @run-at document-start // @namespace https://greasyfork.org/scripts/412212 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 2358aeeaf..03fb456cc 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -15,6 +15,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412205 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== var menu_ALL = [ diff --git a/Zhiyoo-Beautification.user.js b/Zhiyoo-Beautification.user.js index e1bb66d9d..7d4c2100f 100644 --- a/Zhiyoo-Beautification.user.js +++ b/Zhiyoo-Beautification.user.js @@ -8,6 +8,8 @@ // @license GPL-3.0 License // @run-at document-start // @namespace https://greasyfork.org/scripts/412361 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index db22ec92f..39c37201a 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -16,6 +16,8 @@ // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412362 +// @supportURL https://github.com/XIU2/UserScript +// @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== (function() { From ae84aee3d3c345d21a6d84e3daeefa938ddd7305 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 17 Jul 2021 09:20:07 +0800 Subject: [PATCH 0324/2377] =?UTF-8?q?=E5=90=AF=E7=94=A8=20JS=20=E4=B8=A5?= =?UTF-8?q?=E6=A0=BC=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Beautification.user.js | 1 + 3dm-Enhanced.user.js | 1 + 52pojie-Beautification.user.js | 1 + 52pojie-Enhanced.user.js | 1 + Autopage.user.js | 1 + DarkMode.user.js | 1 + GithubEnhanced-High-Speed-Download.user.js | 1 + GoogleTranslate-Beautification.user.js | 1 + Hostloc-Enhanced.user.js | 1 + Lanzou-Enhanced.user.js | 2 ++ V2ex-Enhanced.user.js | 1 + Zhihu-Beautification.user.js | 1 + Zhihu-Enhanced.user.js | 1 + Zhiyoo-Beautification.user.js | 1 + Zhiyoo-Enhanced.user.js | 1 + 15 files changed, 16 insertions(+) diff --git a/3dm-Beautification.user.js b/3dm-Beautification.user.js index b61ba0d08..0a0f450c4 100644 --- a/3dm-Beautification.user.js +++ b/3dm-Beautification.user.js @@ -12,6 +12,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { let style_Add = document.createElement('style'); style_Add.innerHTML = ` diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index f76651817..0a45baa35 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -19,6 +19,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_ALL = [ ['menu_autoReply', '自动回复', '自动回复', true], diff --git a/52pojie-Beautification.user.js b/52pojie-Beautification.user.js index e474782ab..f18860480 100644 --- a/52pojie-Beautification.user.js +++ b/52pojie-Beautification.user.js @@ -18,6 +18,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_ALL = [ ['menu_rule', '隐藏版规', '隐藏版规', false] diff --git a/52pojie-Enhanced.user.js b/52pojie-Enhanced.user.js index f6481eaff..3991fd76c 100644 --- a/52pojie-Enhanced.user.js +++ b/52pojie-Enhanced.user.js @@ -19,6 +19,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_ALL = [ ['menu_autoClockIn', '自动签到', '自动签到', true], diff --git a/Autopage.user.js b/Autopage.user.js index d29e3f10a..8e68dae4e 100644 --- a/Autopage.user.js +++ b/Autopage.user.js @@ -36,6 +36,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { // 注册脚本菜单 GM_registerMenuCommand('反馈 & 欢迎申请支持', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});}); diff --git a/DarkMode.user.js b/DarkMode.user.js index 51749f44c..eac1c0858 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -23,6 +23,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_ALL = [ ['menu_runDuringTheDay', '白天保持开启 (比晚上亮一点点)', '白天保持开启', true], diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 6a59cd7af..58fff9269 100644 --- a/GithubEnhanced-High-Speed-Download.user.js +++ b/GithubEnhanced-High-Speed-Download.user.js @@ -19,6 +19,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var backColor = '#ffffff'; var fontColor = '#888888'; diff --git a/GoogleTranslate-Beautification.user.js b/GoogleTranslate-Beautification.user.js index bcf84f370..6c6904a28 100644 --- a/GoogleTranslate-Beautification.user.js +++ b/GoogleTranslate-Beautification.user.js @@ -19,6 +19,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_streamline = GM_getValue('xiu2_menu_streamline'); var menu_streamline_ID, menu_feedBack_ID; diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index f73a824ab..491458b30 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -20,6 +20,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_ALL = [ ['menu_autoSignIn', '自动签到', '自动签到', true], diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index f18cb8db8..abdf128e5 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -30,6 +30,8 @@ // @supportURL https://github.com/XIU2/UserScript // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== + +'use strict'; (function() { var menu_ALL = [ ['menu_open_fileSha', '自动打开分享链接', '自动打开分享链接', true], diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index e5d3ae5ee..eeb2d403a 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -20,6 +20,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_ALL = [ ['menu_autoClockIn', '自动签到', '自动签到', true], diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js index 25ee455f7..e65c37990 100644 --- a/Zhihu-Beautification.user.js +++ b/Zhihu-Beautification.user.js @@ -19,6 +19,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_ALL = [ ['menu_widescreenDisplay', '宽屏显示', '宽屏显示', true], diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 03fb456cc..58088e49c 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -19,6 +19,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; var menu_ALL = [ ['menu_collapsedAnswer', '一键收起回答', '一键收起回答', true], ['menu_collapsedNowAnswer', '收起当前回答/评论(点击两侧空白处)', '收起当前回答/评论', true], diff --git a/Zhiyoo-Beautification.user.js b/Zhiyoo-Beautification.user.js index 7d4c2100f..43569b53f 100644 --- a/Zhiyoo-Beautification.user.js +++ b/Zhiyoo-Beautification.user.js @@ -12,6 +12,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { let style_Add = document.createElement('style'); style_Add.innerHTML = ` diff --git a/Zhiyoo-Enhanced.user.js b/Zhiyoo-Enhanced.user.js index 39c37201a..0a271d61f 100644 --- a/Zhiyoo-Enhanced.user.js +++ b/Zhiyoo-Enhanced.user.js @@ -20,6 +20,7 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== +'use strict'; (function() { var menu_ALL = [ ['menu_autoReply', '自动回复', '自动回复', true], From 283b5724674b2177405c935e83b9066c92994077 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Sat, 17 Jul 2021 20:51:07 +0800 Subject: [PATCH 0325/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=97=A0=E7=BC=9D=E7=BF=BB=E9=A1=B5]=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=88=AB=E4=BA=BA=E7=9A=84=E5=9B=9E=E5=A4=8D=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hostloc-Enhanced.user.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 491458b30..2248b96bd 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 全球主机交流论坛增强 -// @version 1.2.9 +// @version 1.3.0 // @author X.I.U // @description 自动签到(访问空间)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、回帖小尾巴、自动无缝翻页、快捷回到顶部(右键点击两侧空白处)、收起预览帖子(左键点击两侧空白处)、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复、屏蔽阅读权限 255 帖子 // @match *://hostloc.com/* @@ -137,6 +137,15 @@ HT_insert: ['css;div#threadlist div.bm_c table', 2], replaceE: 'css;div.pg', } + }, + youreply: { + SiteTypeID: 5, + pager: { + nextLink: '//a[@class="nxt"][@href]', + pageElement: 'css;tbody > tr', + HT_insert: ['css;tbody', 2], + replaceE: 'css;div.pg', + } } }; @@ -183,6 +192,8 @@ blockUsers('pm'); // 屏蔽用户(黑名单) } else if(location.pathname === '/forum.php' && location.search.indexOf('mod=guide&view=my&type=reply') > -1) { // 我的帖子:回复 curSite = DBSite.myreply; + } else if(location.pathname === '/home.php' && location.search.indexOf('&do=thread&view=me') > -1) { // 别人的帖子:回复 + curSite = DBSite.youreply; } else if(location.pathname === '/forum.php' && location.search.indexOf('mod=post&action=reply') > -1 || location.pathname === '/forum.php' && location.search.indexOf('mod=post&action=newthread') > -1) { // 回复:高级回复 littleTail('reply'); // 小尾巴 } From 8c29d632c9edb963d0189efd6a932263621196c7 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Mon, 19 Jul 2021 15:35:49 +0800 Subject: [PATCH 0326/2377] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E7=94=A8=E6=88=B7]=20=E6=8C=89=E9=92=AE=E5=88=B0?= =?UTF-8?q?=E7=BD=91=E9=A1=B5=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 66 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index 58088e49c..c550db2a8 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 知乎增强 -// @version 1.4.6 +// @version 1.4.7 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽指定关键词(标题)、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* @@ -14,7 +14,7 @@ // @grant GM_notification // @license GPL-3.0 License // @run-at document-end -// @namespace https://greasyfork.org/scripts/412205 +// @namespace https://greasyfork.org/scripts/4122051 // @supportURL https://github.com/XIU2/UserScript // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== @@ -244,8 +244,12 @@ function blockUsers(type) { case 'search': blockUsers_search(); break; + case 'people': + blockUsers_button_people(); // 添加屏蔽用户按钮(用户主页) + break; } - blockUsers_comment(); // 评论区 + blockUsers_comment(); // 评论区 + blockUsers_button(); // 加入黑名单按钮 function blockUsers_index() { let blockUsers = e => { @@ -346,11 +350,65 @@ function blockUsers(type) { } } }) + + // 添加屏蔽用户按钮(点赞、回复等按钮后面) + if (item1) { + let footer = item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('.CommentItemV2-metaSibling > .CommentItemV2-footer'); + if (footer && !footer.lastElementChild.dataset.name) { + footer.insertAdjacentHTML('beforeend',``); + footer.lastElementChild.onclick = function(){blockUsers_button_add(this.dataset.name)} + } + } }) } } document.addEventListener('DOMNodeInserted', blockUsers); // 监听插入事件 } + + // 添加屏蔽用户按钮(用户信息悬浮框中) + function blockUsers_button() { + let blockUsers = e => { + if (e.target.innerHTML && e.target.querySelector('.MemberButtonGroup.ProfileButtonGroup.HoverCard-buttons')) { + let item = e.target.querySelector('.MemberButtonGroup.ProfileButtonGroup.HoverCard-buttons'), + name = item.parentNode.parentNode.querySelector('a.UserLink-link').innerText; + item.insertAdjacentHTML('beforeend', ``); + item.lastElementChild.onclick = function(){blockUsers_button_add(this.dataset.name)} + } + } + document.addEventListener('DOMNodeInserted', blockUsers); // 监听插入事件 + } + + // 添加屏蔽用户按钮(用户主页) + function blockUsers_button_people() { + let item = document.querySelector('.MemberButtonGroup.ProfileButtonGroup.ProfileHeader-buttons'), // 获取按钮元素位置 + name = document.querySelector('.ProfileHeader-name').firstChild.textContent, // 获取用户名 + users = menu_value('menu_customBlockUsers'); // 读取屏蔽列表 + for (let num = 0;num