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 0001/2073] =?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 0002/2073] =?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 0003/2073] 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 0004/2073] 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 0005/2073] =?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 0006/2073] =?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 0007/2073] =?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 0008/2073] =?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已屏蔽`); + return + } + }; + if (item) { + item.insertAdjacentHTML('beforeend', ``); + item.lastElementChild.onclick = function(){blockUsers_button_add(this.dataset.name)} + } + } + + // 屏蔽用户按钮绑定事件 + function blockUsers_button_add(name) { + if (!name) return + let users = menu_value('menu_customBlockUsers'); // 读取屏蔽列表 + for (let num = 0;num Date: Tue, 20 Jul 2021 12:20:16 +0800 Subject: [PATCH 0009/2073] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E5=BD=93=E5=89=8D=E7=BD=91=E7=AB=99=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E6=8A=A4=E7=9C=BC=E6=A8=A1=E5=BC=8F]=20=E5=8A=9F=E8=83=BD;=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E5=AF=B9=E5=BD=93=E5=89=8D=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E5=90=AF=E7=94=A8/=E7=A6=81=E7=94=A8]=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD;=20=E4=BC=98=E5=8C=96=20=E8=84=9A=E6=9C=AC=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DarkMode.user.js | 172 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 149 insertions(+), 23 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index eac1c0858..6d10fb7db 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.1.6 +// @version 1.2.0 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -26,19 +26,18 @@ 'use strict'; (function() { var menu_ALL = [ + ['menu_disable', '✅ 已启用 (点击对当前网站禁用)', '❎ 已禁用 (点击对当前网站启用)', []], ['menu_runDuringTheDay', '白天保持开启 (比晚上亮一点点)', '白天保持开启', true], - ['menu_autoRecognition', '排除自带暗黑模式的网页 (beta)', '排除自带暗黑模式的网页 (beta)', true], + ['menu_autoRecognition', '智能排除自带暗黑模式的网页 (beta)', '智能排除自带暗黑模式的网页 (beta)', true], + ['menu_forcedToEnable', '✅ 已强制当前网站启用护眼模式 (👆)', '❎ 未强制当前网站启用护眼模式 (👆)', []], ['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'] - ], menu_ID = [], websiteList = ['rarbgprx.org','fitgirl-repacks.site','masquerade.site','www.gamersky.com']; + ['menu_customMode', '自定义当前模式', '自定义当前模式', true], ['menu_customMode1',,,'80|70'], ['menu_customMode2',,,'80|20|70|30'], ['menu_customMode3',,,'80'] + ], menu_ID = []; for (let i=0;i 1) {addStyle();} // 注册脚本菜单 @@ -50,29 +49,66 @@ } for (let i=0;i 3){ // 避免在减少 raw 数组后,用户储存的数据大于数组而报错 + if (menu_ALL[i][0] === 'menu_disable') + { // 启用/禁用护眼模式 (当前网站) + if (menu_disable('check')) { // 当前网站是否已存在禁用列表中 + menu_ID[i] = GM_registerMenuCommand(`${menu_ALL[i][2]}`, function(){menu_disable('del')}); + return + } else { + menu_ID[i] = GM_registerMenuCommand(`${menu_ALL[i][1]}`, function(){menu_disable('add')}); + } + } + else if (menu_ALL[i][0] === 'menu_darkModeType') + { // 点击切换模式 + if (menu_ALL[i][3] > 3) { // 避免在减少 raw 数组后,用户储存的数据大于数组而报错 menu_ALL[i][3] = 1; - GM_setValue('menu_darkModeType', menu_ALL[i][3]); + GM_setValue(menu_ALL[i][0], 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]); - } else if (menu_ALL[i][0] === 'menu_customMode2') { - GM_setValue('menu_customMode2', menu_ALL[i][3]); - } else if (menu_ALL[i][0] === 'menu_customMode3') { - GM_setValue('menu_customMode3', menu_ALL[i][3]); - } 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[i] = GM_registerMenuCommand(`${menu_num(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_ALL[i][0], menu_ALL[i][3]); + menu_ID[i] = GM_registerMenuCommand(`#️⃣ ${menu_ALL[i][1]}`, function(){menu_customMode()}); + } + else if (menu_ALL[i][0] === 'menu_customMode1' || menu_ALL[i][0] === 'menu_customMode2' || menu_ALL[i][0] === 'menu_customMode3') + { // 当前模式值 + GM_setValue(menu_ALL[i][0], menu_ALL[i][3]); + } + else if (menu_ALL[i][0] === 'menu_forcedToEnable') + { // 强制当前网站启用护眼模式 + if (menu_value('menu_autoRecognition')) { // 自动排除自带暗黑模式的网页 (beta) + if (menu_forcedToEnable('check')) { // 当前网站是否已存在列表中 + menu_ID[i] = GM_registerMenuCommand(`${menu_ALL[i][1]}`, function(){menu_forcedToEnable('del')}); + } else { + menu_ID[i] = GM_registerMenuCommand(`${menu_ALL[i][2]}`, function(){menu_forcedToEnable('add')}); + } + } + } + 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_num(num) { + switch(num) { + case 1: + return '1️⃣' + break; + case 2: + return '2️⃣' + break; + case 3: + return '3️⃣' + break; + } + } + + // 自定义当前模式 function menu_customMode() { let newMods, tip, defaults, name; @@ -108,6 +144,94 @@ } + // 强制当前网站启用护眼模式 + function menu_forcedToEnable(type) { + switch(type) { + case 'check': + if(check()) return true + return false + break; + case 'add': + add(); + break; + case 'del': + del(); + break; + } + + function check() { // 存在返回真,不存在返回假 + let websiteList = menu_value('menu_forcedToEnable'); // 读取网站列表 + for (let num = 0;num Date: Tue, 20 Jul 2021 12:38:28 +0800 Subject: [PATCH 0010/2073] =?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, 8 insertions(+), 2 deletions(-) diff --git a/DarkMode.user.js b/DarkMode.user.js index 6d10fb7db..d9d2d85b8 100644 --- a/DarkMode.user.js +++ b/DarkMode.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 护眼模式 -// @version 1.2.0 +// @version 1.2.1 // @author X.I.U // @description 简单有效的全网通用护眼模式、夜间模式、暗黑模式 // @match *://*/* @@ -254,6 +254,9 @@ GM_setValue(`${Name}`, true); GM_notification({text: `已开启 [${Tips}] 功能\n(刷新网页后生效)`, timeout: 3500}); } + if (Name === 'menu_autoRecognition') { + location.reload(); // 刷新网页 + } registerMenuCommand(); // 重新注册脚本菜单 }; @@ -332,7 +335,10 @@ }, 5); } - let websiteList = menu_value('menu_forcedToEnable'); // 强制当前网站启用护眼模式 + let websiteList = []; + if (menu_value('menu_autoRecognition')) { // 智能排除自带暗黑模式的网页 (beta) + websiteList = menu_value('menu_forcedToEnable'); // 强制当前网站启用护眼模式 + } // 为了避免 body 还没加载导致无法检查是否设置背景颜色 let timer = setInterval(function(){ // 每 10 毫秒检查一下 body 是否已存在 From 7d869623cb783e4230684e5b2fa64ef3229d8192 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Tue, 20 Jul 2021 13:33:51 +0800 Subject: [PATCH 0011/2073] =?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=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3dm-Enhanced.user.js | 4 +-- 52pojie-Beautification.user.js | 32 ++++++++++++++-------- 52pojie-Enhanced.user.js | 4 +-- Autopage.user.js | 2 +- GithubEnhanced-High-Speed-Download.user.js | 28 ++++++++++++++++++- Hostloc-Enhanced.user.js | 12 ++++---- Lanzou-Enhanced.user.js | 6 ++-- V2ex-Enhanced.user.js | 4 +-- Zhihu-Beautification.user.js | 23 ++++++++++++++-- Zhihu-Enhanced.user.js | 8 +++--- Zhiyoo-Enhanced.user.js | 19 ++++--------- 11 files changed, 93 insertions(+), 49 deletions(-) diff --git a/3dm-Enhanced.user.js b/3dm-Enhanced.user.js index 0a45baa35..1ab45edda 100644 --- a/3dm-Enhanced.user.js +++ b/3dm-Enhanced.user.js @@ -41,9 +41,9 @@ } for (let i=0;i 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_menu_raw_fast_ID = GM_registerMenuCommand(`${menu_num(menu_raw_fast)} [ ${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});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412245/feedback', {active: true,insert: true,setParent: true});}); } @@ -109,6 +109,32 @@ registerMenuCommand(); // 重新注册脚本菜单 }; + function menu_num(num) { + switch(num) { + case 0: + return '0️⃣' + break; + case 1: + return '1️⃣' + break; + case 2: + return '2️⃣' + break; + case 3: + return '3️⃣' + break; + case 4: + return '4️⃣' + break; + case 5: + return '5️⃣' + break; + case 6: + return '6️⃣' + break; + } + } + addRelease(); // Release 加速 addDownloadZIP(); // Download ZIP 加速 addGitClone(); // Git Clone 加速 diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js index 2248b96bd..884f077d7 100644 --- a/Hostloc-Enhanced.user.js +++ b/Hostloc-Enhanced.user.js @@ -53,18 +53,18 @@ for (let i=0;i Date: Thu, 22 Jul 2021 11:47:26 +0800 Subject: [PATCH 0012/2073] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E6=9F=90=E6=AC=A1=E6=9B=B4=E6=96=B0=E5=90=8E=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=B5=8F=E8=A7=88=E5=99=A8=E5=89=8D=E8=BF=9B/?= =?UTF-8?q?=E5=90=8E=E9=80=80=E9=9C=80=E8=A6=81=E7=82=B9=E5=87=BB=E4=B8=A4?= =?UTF-8?q?=E6=AC=A1=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 | 44 +++++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/GithubEnhanced-High-Speed-Download.user.js b/GithubEnhanced-High-Speed-Download.user.js index 801f2a5c8..41d4f8294 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.5 +// @version 1.5.6 // @author X.I.U // @description 高速下载 Git Clone/SSH、Release、Raw、Code(ZIP) 等文件、项目列表单文件快捷下载 (☁) // @match *://github.com/* @@ -19,8 +19,8 @@ // @homepageURL https://github.com/XIU2/UserScript // ==/UserScript== -'use strict'; (function() { + 'use strict'; var backColor = '#ffffff'; var fontColor = '#888888'; if (document.getElementsByTagName('html')[0].getAttribute('data-color-mode') === 'dark') { // 黑暗模式判断 @@ -151,15 +151,27 @@ setTimeout(addRawDownLink, 2000); // 添加 Raw 下载链接(☁),延迟 2 秒执行,避免被 pjax 刷掉 }); - pushHistory(); + addLocationchange(); + window.addEventListener('locationchange', function(){ + addRawDownLink_(); // 在浏览器返回/前进时重新添加 Raw 下载链接(☁)事件 + }) + + /*pushHistory(); window.addEventListener('popstate', function(e) { - addRawDownLink_(); // 在浏览器返回/前进时重新添加 Raw 下载链接(☁)鼠标事件 + addRawDownLink_(); // 在浏览器返回/前进时重新添加 Raw 下载链接(☁)事件 }, false); function pushHistory() { let state = {title: 'title',url: '#'}; window.history.pushState(state, '', ''); - } + }*/ + /*let oldUrl = location.href, + timer = setInterval(function(){ + if (oldUrl != location.href) { + oldUrl = location.href; + addRawDownLink_(); // 在浏览器返回/前进时重新添加 Raw 下载链接(☁)事件 + } + }, 1000);*/ // Release function addRelease() { @@ -410,4 +422,26 @@ trElm.onmouseout = mouseOutHandler; }); } + + + // 自定义 locationchange 事件(用来监听 URL 变化,针对的是 Github 这种因为使用 pjax 而无法依靠 hashchange 监听的网页) + function addLocationchange() { + history.pushState = ( f => function pushState(){ + var ret = f.apply(this, arguments); + window.dispatchEvent(new Event('pushstate')); + window.dispatchEvent(new Event('locationchange')); + return ret; + })(history.pushState); + + history.replaceState = ( f => function replaceState(){ + var ret = f.apply(this, arguments); + window.dispatchEvent(new Event('replacestate')); + window.dispatchEvent(new Event('locationchange')); + return ret; + })(history.replaceState); + + window.addEventListener('popstate',()=>{ + window.dispatchEvent(new Event('locationchange')) + }); + } })(); \ No newline at end of file From 9092e5d3eba4798afb4bbe71df8e710667ca354a Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 22 Jul 2021 12:14:39 +0800 Subject: [PATCH 0013/2073] =?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=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + TargetBlank.user.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 TargetBlank.user.js diff --git a/README.md b/README.md index 4bdb4f06b..68f6bb817 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ | [](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://github.com/XIU2) | **新标签页打开链接** | 将网页中所有链接改为新标签页打开~ | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/TargetBlank.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)** | diff --git a/TargetBlank.user.js b/TargetBlank.user.js new file mode 100644 index 000000000..702a269b5 --- /dev/null +++ b/TargetBlank.user.js @@ -0,0 +1,21 @@ +// ==UserScript== +// @name 新标签页打开链接 +// @version 1.0.0 +// @author X.I.U +// @description 将网页中所有链接改为新标签页打开~ +// @match *://*/* +// @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png +// @grant none +// @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() { + 'use strict'; + Array.from(document.links).forEach(function (_this) { + _this.target = '_blank' + }) +})(); \ No newline at end of file From 32cbb40caf47956f271caf395d23f6bc2a6e5c72 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 22 Jul 2021 12:27:46 +0800 Subject: [PATCH 0014/2073] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68f6bb817..519532b8c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ | [](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://github.com/XIU2) | **新标签页打开链接** | 将网页中所有链接改为新标签页打开~ | **[安装](https://greasyfork.org/zh-CN/scripts/426377)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/TargetBlank.user.js)** | +| [](https://github.com/XIU2) | **新标签页打开链接** | 将网页中所有链接改为新标签页打开~ | **[安装](https://greasyfork.org/zh-CN/scripts/429714)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/TargetBlank.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)** | From c43823cf5ae8da0822fa6e9852a70177587a0024 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Thu, 22 Jul 2021 12:45:44 +0800 Subject: [PATCH 0015/2073] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 519532b8c..a3ef7abfb 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ | [](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://github.com/XIU2) | **新标签页打开链接** | 将网页中所有链接改为新标签页打开~ | **[安装](https://greasyfork.org/zh-CN/scripts/429714)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/TargetBlank.user.js)** | +| [](https://github.com/XIU2) | **新标签页打开链接 \*** | 将网页中所有链接改为新标签页打开~ | **[安装](https://greasyfork.org/zh-CN/scripts/429714)** \| **[备用](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/TargetBlank.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)** | From f4d02e3f308a4efacd91e2b4b5e071baf76bca30 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 23 Jul 2021 07:48:50 +0800 Subject: [PATCH 0016/2073] README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3ef7abfb..69de3f2e9 100644 --- a/README.md +++ b/README.md @@ -60,4 +60,4 @@ The GPL-3.0 License. 所有脚本仅供学习交流,请勿用于商用等其他用途。 -软件所有权归 X.I.U(XIU2) 所有。 \ No newline at end of file +脚本所有权归 X.I.U(XIU2) 所有。 \ No newline at end of file From 49cfa531a5a45e75beefa801f383c4c56b9364b2 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 23 Jul 2021 20:48:07 +0800 Subject: [PATCH 0017/2073] =?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=E5=8A=9F=E8=83=BD=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=90=8C=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=88=B0=E7=9F=A5?= =?UTF-8?q?=E4=B9=8E=E8=87=AA=E5=B8=A6=E7=9A=84=E9=BB=91=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 86 ++++++++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 20 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index a7b5d3b7d..a53d230d4 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,11 +1,12 @@ // ==UserScript== // @name 知乎增强 -// @version 1.4.7 +// @version 1.4.8 // @author X.I.U // @description 移除登录弹窗、一键收起回答、收起当前回答/评论(点击两侧空白处)、快捷回到顶部(右键两侧空白处)、屏蔽指定用户、屏蔽指定关键词(标题)、屏蔽盐选内容、置顶显示时间、显示问题时间、区分问题文章、默认高清原图、默认站外直链 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/heifetz/favicon.ico +// @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_openInTab @@ -218,7 +219,7 @@ function isElementInViewport(el) { // 自定义屏蔽用户 function customBlockUsers() { let nowBlockUsers = ''; - menu_value('menu_customBlockUsers').forEach(function(item){nowBlockUsers = nowBlockUsers + '|' + item}) + menu_value('menu_customBlockUsers').forEach(function(item){nowBlockUsers += '|' + item}) let newBlockUsers = prompt('编辑 [自定义屏蔽用户]\n(不同用户名之间使用 "|" 分隔,例如:用户A|用户B|用户C )', nowBlockUsers.replace('|','')); if (newBlockUsers === '') { GM_setValue('menu_customBlockUsers', []); @@ -353,10 +354,12 @@ 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)} + let footer = item1.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector('.CommentItemV2-metaSibling > .CommentItemV2-footer'), + userid = item1.parentNode; + if (userid && footer && !footer.lastElementChild.dataset.name) { + userid = userid.href.split('/')[4]; + footer.insertAdjacentHTML('beforeend',``); + footer.lastElementChild.onclick = function(){blockUsers_button_add(this.dataset.name, this.dataset.userid, false)} } } }) @@ -370,9 +373,11 @@ function blockUsers(type) { 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)} + item1 = item.parentNode.parentNode.querySelector('a.UserLink-link'), + name = item1.innerText, + userid = item1.href.split('/')[4]; + item.insertAdjacentHTML('beforeend', ``); + item.lastElementChild.onclick = function(){blockUsers_button_add(this.dataset.name, this.dataset.userid, false)} } } document.addEventListener('DOMNodeInserted', blockUsers); // 监听插入事件 @@ -382,32 +387,73 @@ function blockUsers(type) { function blockUsers_button_people() { let item = document.querySelector('.MemberButtonGroup.ProfileButtonGroup.ProfileHeader-buttons'), // 获取按钮元素位置 name = document.querySelector('.ProfileHeader-name').firstChild.textContent, // 获取用户名 - users = menu_value('menu_customBlockUsers'); // 读取屏蔽列表 + users = menu_value('menu_customBlockUsers'), // 读取屏蔽列表 + userid = location.href.split('/')[4]; for (let num = 0;num