',
url = '', _html = '', _gitClone = '';
if (html.nextElementSibling) html.nextElementSibling.hidden = true; // 隐藏右侧复制按钮(考虑到能直接点击复制,就不再重复实现复制按钮事件了)
- if (html.parentElement.nextElementSibling.tagName === 'SPAN'){
- html.parentElement.nextElementSibling.textContent += ' (↑点击上面文字可复制)'
+ if (html.parentElement.nextElementSibling.tagName === 'P'){
+ html.parentElement.nextElementSibling.textContent += ' (↑点击文字自动复制)'
}
if (GM_getValue('menu_gitClone')) {_gitClone='git clone '; html.value = _gitClone + html.value; html.setAttribute('value', html.value);}
// 克隆原 Git Clone 元素
@@ -381,8 +331,8 @@
html_parent = '
',
url = '', _html = '', _gitClone = '';
html.nextElementSibling.hidden = true; // 隐藏右侧复制按钮(考虑到能直接点击复制,就不再重复实现复制按钮事件了)
- if (html.parentElement.nextElementSibling.tagName === 'SPAN'){
- html.parentElement.nextElementSibling.textContent += ' (↑点击文字可复制)'
+ if (html.parentElement.nextElementSibling.tagName === 'P'){
+ html.parentElement.nextElementSibling.textContent += ' (↑点击自动复制)'
}
if (GM_getValue('menu_gitClone')) {_gitClone='git clone '; html.value = _gitClone + html.value; html.setAttribute('value', html.value);}
// 克隆原 Git Clone SSH 元素
@@ -555,4 +505,4 @@
window.dispatchEvent(new Event('urlchange'))
});
}
-})();
+})();
\ No newline at end of file
diff --git a/HTML5Volume.user.js b/HTML5Volume.user.js
index 6bcc4388e..1938bca0f 100644
--- a/HTML5Volume.user.js
+++ b/HTML5Volume.user.js
@@ -3,7 +3,7 @@
// @name:zh-CN HTML5 视频音频默认音量
// @name:zh-TW HTML5 視訊音訊預設音量
// @name:ru Громкость аудио-видео в формате HTML5 по умолчанию
-// @version 1.0.3
+// @version 1.0.5
// @author X.I.U
// @description Avoid being startled by some video/audio with default 100% volume! And support each website to remember the volume separately...
// @description:zh-CN 避免被一些默认 100% 音量的视频/音频吓一跳(或社死)!且支持各网站分别记住音量...
@@ -34,12 +34,58 @@
let nowVolume = ' (跟随全局)'
if (localStorage.getItem('html5_xiu_currentVolume')) nowVolume = ' [ ' + parseInt(localStorage.getItem('html5_xiu_currentVolume')) + '% ]'
menu_ID[1] = GM_registerMenuCommand('🔁 忘记当前网站音量' + nowVolume, function(){resetCurrentVolume()});
- menu_ID[2] = GM_registerMenuCommand('💬 反馈 & 建议', function () {GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true}); GM_openInTab('https://greasyfork.org/zh-CN/scripts/438400/feedback', {active: true,insert: true,setParent: true});});
+ // 强制当前网站使用全局音量(针对部分不支持调节音量的网站)
+ if (menu_forcedToEnable('check')) { // 当前网站是否已存在强制列表中
+ menu_ID[2] = GM_registerMenuCommand('✅ 已强制当前网站使用全局音量 (针对不支持调节音量的)', function(){menu_forcedToEnable('del')});
+ menu_ID[4] = GM_registerMenuCommand('#️⃣ 修改当前网站默认音量 (针对不支持调节音量的)', function(){customCurrentDefaultVolume()});
+ } else {
+ menu_ID[2] = GM_registerMenuCommand('❌ 未强制当前网站使用全局音量 (针对不支持调节音量的)', function(){menu_forcedToEnable('add')});
+ }
+ menu_ID[3] = GM_registerMenuCommand('💬 反馈 & 建议', function () {GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true}); GM_openInTab('https://greasyfork.org/zh-CN/scripts/438400/feedback', {active: true,insert: true,setParent: true});});
}
insPage();
currentPage();
+ // 强制当前网站使用全局音量(针对部分不支持调节音量的网站)
+ 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 = GM_getValue('menu_forcedToEnable',[]); // 读取网站列表
+ if (websiteList.indexOf(location.host) === -1) return false // 不存在返回假
+ return true
+ }
+
+ function add() {
+ if (check()) return
+ let websiteList = GM_getValue('menu_forcedToEnable',[]); // 读取网站列表
+ websiteList.push(location.host); // 追加网站域名
+ GM_setValue('menu_forcedToEnable', websiteList); // 写入配置
+ location.reload(); // 刷新网页
+ }
+
+ function del() {
+ if (!check()) return
+ let websiteList = GM_getValue('menu_forcedToEnable',[]), // 读取网站列表
+ index = websiteList.indexOf(location.host);
+ websiteList.splice(index, 1); // 删除网站域名
+ GM_setValue('menu_forcedToEnable', websiteList); // 写入配置
+ location.reload(); // 刷新网页
+ }
+ }
+
// 网页本身的 Video Audio 标签
function currentPage() {
@@ -88,12 +134,16 @@
// 判断该视频/音频元素是否已监听事件
function isFirstEvent(target) {
- if (!target.controls) return; // 如果视频/音频已经有了自己的控件(即没有使用 HTML5 默认的控件),则退出
+ if (!menu_forcedToEnable('check')) { // 如果未强制当前网站使用全局音量(针对部分不支持调节音量的网站)
+ if (!target.controls) return; // 如果视频/音频已经有了自己的控件(即没有使用 HTML5 默认的控件),则退出
+ }
modifyVolume(target);
- // 如果没有该属性,则代表是还未监听事件
- if (target.dataset.html5VolumeXiu != 'true') {
- target.dataset.html5VolumeXiu = 'true'
- target.addEventListener('volumechange', volumeChangeEvent);
+ if (!menu_forcedToEnable('check')) { // 如果未强制当前网站使用全局音量(针对部分不支持调节音量的网站),毕竟不支持音量调节的网站监听音量变化是没有意义的,反而可能会被网站默认静音什么的搞乱
+ // 如果没有该属性,则代表是还未监听事件
+ if (target.dataset.html5VolumeXiu != 'true') {
+ target.dataset.html5VolumeXiu = 'true'
+ target.addEventListener('volumechange', volumeChangeEvent);
+ }
}
}
@@ -111,8 +161,18 @@
// 修改全局默认音量
function customDefaultVolume() {
- let newValue = parseFloat(prompt('修改全局默认音量,不影响各网站记住的音量,当前网页需刷新后生效~\n范围:0~100 (即 0%~100%,不需要加 % 百分号)\n默认:30', GM_getValue('menu_defaultVolume', 30)));
+ let newValue = parseFloat(prompt('修改全局默认音量,不影响各网站记住的音量,修改后当前网页立即生效~\n范围:0~100 (即 0%~100%,不需要加 % 百分号)\n默认:30', GM_getValue('menu_defaultVolume', 30)));
if (!Number.isNaN(newValue) && newValue >= 0 && newValue <= 100) {GM_setValue('menu_defaultVolume', newValue);}
+ currentPage(); // 重置当前网页的音量
+ registerMenuCommand(); // 重新注册菜单(刷新菜单上的音量值)
+ }
+
+
+ // 修改当前网站默认音量 (针对不支持调节音量的网站)
+ function customCurrentDefaultVolume() {
+ let newValue = parseFloat(prompt('修改当前网站默认音量 (针对不支持调节音量的网站),修改后立即生效~\n范围:0~100 (即 0%~100%,不需要加 % 百分号)\n默认:全局默认音量', localStorage.getItem('html5_xiu_currentVolume') || GM_getValue('menu_defaultVolume', 30)));
+ if (!Number.isNaN(newValue) && newValue >= 0 && newValue <= 100) {localStorage.setItem('html5_xiu_currentVolume', newValue);}
+ currentPage(); // 重置当前网页的音量
registerMenuCommand(); // 重新注册菜单(刷新菜单上的音量值)
}
@@ -121,5 +181,6 @@
function resetCurrentVolume() {
if (localStorage.getItem('html5_xiu_currentVolume')) localStorage.removeItem('html5_xiu_currentVolume') // 清理 localStorage
currentPage(); // 重置当前网页的音量
+ registerMenuCommand(); // 重新注册菜单(刷新菜单上的音量值)
}
})();
diff --git a/Hostloc-Enhanced.user.js b/Hostloc-Enhanced.user.js
index 4f5084961..2a8b2aaca 100644
--- a/Hostloc-Enhanced.user.js
+++ b/Hostloc-Enhanced.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 全球主机交流论坛增强
-// @version 1.5.1
+// @version 1.5.2
// @author X.I.U
// @description 自动签到(访问空间 +22 积分)、屏蔽用户(黑名单)、屏蔽关键词(帖子标题)、回帖小尾巴、自动无缝翻页、快捷回到顶部(右键网页两侧空白处)、收起预览帖子(左键网页两侧空白处)、屏蔽投票贴、快速添加链接、屏蔽阅读权限 255 帖子、预览帖子快速回复带签名、显示是否在线、显示帖子内隐藏回复
// @match *://hostloc.com/*
@@ -454,7 +454,7 @@
if (item.querySelector('[id^="userinfo"] > .i.y em')) {
let icon = (item.querySelector('[id^="userinfo"] > .i.y em').textContent === '当前在线') ? '🌝' : '🌚';
let divStatus = document.createElement('div');
- divStatus.style = 'position: absolute;margin: -8px 0 0 8px;padding: 0px 1px;background-color: #ffffff;border-radius: 50%;z-index: 999999;';
+ divStatus.style = 'position: absolute;margin: -8px 0 0 8px;padding: 0px 1px;background-color: #ffffff;border-radius: 50%;z-index: 302;';
divStatus.textContent = icon;
let mochu = item.querySelector('.avatar');
mochu.parentNode.insertBefore(divStatus, mochu);
@@ -473,7 +473,7 @@
blockButton.className = 'XIU-block-button';
blockButton.title = `屏蔽用户: ${username}`;
blockButton.textContent = '🚫';
- blockButton.style.cssText = 'position: absolute;margin: -8px 0px 0px 8px;padding: 0px 0.5px;top: 0px;right: 10px;background-color: #F26C4F;border-radius: 50%;cursor: pointer;z-index: 999999;box-shadow: 0 2px 4px rgba(0,0,0,0.2);transition: all 0.3s ease;';
+ blockButton.style.cssText = 'position: absolute;margin: -8px 0px 0px 8px;padding: 0px 0.5px;top: 0px;right: 10px;background-color: #F26C4F;border-radius: 50%;cursor: pointer;z-index: 302;box-shadow: 0 2px 4px rgba(0,0,0,0.2);transition: all 0.3s ease;';
// 鼠标悬停效果
if (!document.getElementById('XIU-block-style')) {
diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js
index f0a30b9ef..ed8e63cd4 100644
--- a/Lanzou-Enhanced.user.js
+++ b/Lanzou-Enhanced.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 蓝奏云网盘增强
-// @version 1.5.6
+// @version 1.5.8
// @author X.I.U
// @description 文件排序、刷新不回根目录、快捷返回上一级(右键网页空白处)、后退返回上一级、右键文件显示菜单、点击直接下载文件、点击空白进入目录、自动显示更多文件、一键复制所有分享链接、自定义分享链接域名、自动打开/复制分享链接、带密码的分享链接自动输密码、拖入文件自动显示上传框、输入密码后回车确认、优化编辑框初始大小
// @match *://lanzou.com/u
@@ -52,6 +52,7 @@
// @match *://*.lanzj.com/*
// @match *://*.lanzl.com/*
// @match *://*.lanzm.com/*
+// @match *://*.lanzn.com/*
// @match *://*.lanzo.com/*
// @match *://*.lanzp.com/*
// @match *://*.lanzq.com/*
@@ -347,10 +348,10 @@
if (iframe) { // 只有找到 iframe 框架时才会继续运行脚本
iframe = iframe.contentWindow;
let timer = setInterval(function(){
- if (iframe.document.querySelector('.load>[href]')) {
- //iframe.document.querySelector('.load>a[href]').target = '_top'
- //iframe.document.querySelector('.load>a[href]').click();
- GM_openInTab(iframe.document.querySelector('.load>a[href]').href, {active: false, insert: true, setParent: false}); // 后台打开
+ if (iframe.document.querySelector('.load [href]')) {
+ //iframe.document.querySelector('.load a[href]').target = '_top'
+ //iframe.document.querySelector('.load a[href]').click();
+ GM_openInTab(iframe.document.querySelector('.load a[href]').href, {active: false, insert: true, setParent: false}); // 后台打开
clearInterval(timer);
// 关闭该后台标签页
if (GM_info.scriptHandler === 'Violentmonkey') { // Violentmonkey 需要延迟一会儿
diff --git a/README.md b/README.md
index edd27edc3..d59032f38 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
## 脚本列表
-> _详细的**脚本介绍、使用说明、截图演示**等信息,请点击 **\[安装\]** 前往 GreasyFork 查看~_
+> _详细的**脚本介绍、使用说明、截图演示**等信息,请点击 **`[安装]`** 查看~(或去本项目 [Wiki](https://github.com/XIU2/UserScript/wiki) 查看_
| | 脚本名称 | 脚本功能 | 安装 \| 备用 |
| :----: | :---- | :---- | :----: |
@@ -33,7 +33,7 @@
| [

](https://www.52pojie.cn) | **吾爱破解论坛 美化** | 精简多余内容、样式优化 | **[安装](https://greasyfork.org/zh-CN/scripts/412681)** \| **[备用](https://bitbucket.org/xiu2/userscript/raw/master/52pojie-Beautification.user.js)** |
| [

](https://www.52pojie.cn) | **吾爱破解论坛 增强** | **自动签到**、自动无缝翻页、屏蔽导读悬赏贴 (最新发表页)... | **[安装](https://greasyfork.org/zh-CN/scripts/412680)** \| **[备用](https://bitbucket.org/xiu2/userscript/raw/master/52pojie-Enhanced.user.js)** |
| [

](https://hostloc.com) | **全球主机交流论坛 增强 \*** | **自动访问空间(22积分)、屏蔽用户**、屏蔽关键词、自动翻... | **[安装](https://greasyfork.org/zh-CN/scripts/414005)** \| **[备用](https://bitbucket.org/xiu2/userscript/raw/master/Hostloc-Enhanced.user.js)** |
-| [

](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://bitbucket.org/xiu2/userscript/raw/master/SteamWorkshopImageRepair.user.js)** \| **[备用](https://bitbucket.org/xiu2/userscript/raw/master/SteamWorkshopImageRepair.user.js)** |
+| [

](https://store.steampowered.com) | **Steam 创意工坊大图 修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[安装](https://github.com/XIU2/UserScript/wiki/Steam-%E5%88%9B%E6%84%8F%E5%B7%A5%E5%9D%8A%E5%A4%A7%E5%9B%BE-%E4%BF%AE%E5%A4%8D)** \| **[备用](https://bitbucket.org/xiu2/userscript/raw/master/SteamWorkshopImageRepair.user.js)** |
| [

](https://github.com/XIU2) | **HTML5 视频音频默认音量** | 避免被 100% 音量**吓一跳**!且支持各网站分别记住音量... | **[安装](https://greasyfork.org/zh-CN/scripts/438400)** \| **[备用](https://bitbucket.org/xiu2/userscript/raw/master/HTML5Volume.user.js)** |
| [

](https://github.com/XIU2) | **右键滚动条回到顶部** | 鼠标**右键**网页右侧的**滚动条**即可**回到顶部** | **[安装](https://greasyfork.org/zh-CN/scripts/506959)** \| **[备用](https://bitbucket.org/xiu2/userscript/raw/master/RightClick_ScrollBar_BackToTop.user.js)** |
| [

](https://github.com/XIU2) | **新标签页打开链接 \*** | 将网页中所有链接改为**新标签页打开**(可能存在兼容问题 | **[安装](https://greasyfork.org/zh-CN/scripts/429714)** \| **[备用](https://bitbucket.org/xiu2/userscript/raw/master/TargetBlank.user.js)** |
@@ -49,10 +49,10 @@
## 如何安装/使用脚本?
-要使用任何脚本,首先需要浏览器安装 **Tampermonkey 脚本管理器扩展([Chrome](https://pan.lanpw.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.lanzoub.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 访问速度太慢,可以选择点击 **`[备用]`** 后弹出扩展提示,再去点击 **`[安装]`** 即可。
> [!IMPORTANT]
> - _其他基于 **Chromium** 内核的浏览器(如国内套皮浏览器)一般都可以使用 Chrome 扩展。_
@@ -94,9 +94,6 @@ Tampermonkey 为了顺应 Chrome 的 Manifest V3 要求,在 v5.0.0 版本中

-> 该赞助者向本项目提供了**公益服务器**用以优化体验!
-> This sponsor has provided **a non-profit server** for this project to enhance the user experience!
-
## License
The GPL-3.0 License.
\ No newline at end of file
diff --git a/Zhihu-Beautification.user.js b/Zhihu-Beautification.user.js
index 528062969..584671e36 100644
--- a/Zhihu-Beautification.user.js
+++ b/Zhihu-Beautification.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 知乎美化
-// @version 1.5.16
+// @version 1.5.20
// @author X.I.U
// @description 宽屏显示、暗黑模式(4种)、暗黑模式跟随浏览器、屏蔽首页活动广告、隐藏文章开头大图、调整图片最大高度、向下翻时自动隐藏顶栏
// @match *://www.zhihu.com/*
@@ -44,6 +44,8 @@
}
registerMenuCommand();
addStyle();
+ // 向下翻时自动隐藏顶栏
+ if (menu_value('menu_hideTitle')) setTimeout(hideTitle, 2000);
// 注册脚本菜单
function registerMenuCommand() {
@@ -138,8 +140,10 @@
.zhihuE_SettingRoot .zhihuE_SettingHeader {padding: 10px 20px;color: #fff;font-weight: bold;background-color: #3994ff;border-radius: 3px 3px 0 0;}
.zhihuE_SettingRoot .zhihuE_SettingMain {padding: 10px 20px;border-radius: 0 0 3px 3px;}
.zhihuE_SettingHeader span {float: right;cursor: pointer;}
-.zhihuE_SettingMain input {margin: 10px 6px 10px 0;cursor: pointer;vertical-align:middle}
-.zhihuE_SettingMain label {margin-right: 20px;user-select: none;cursor: pointer;vertical-align:middle}
+.zhihuE_SettingMain input {margin: 10px 6px 10px 0;vertical-align:middle;}
+.zhihuE_SettingMain input[type=text] {margin: 5px 6px 5px 0;padding-block: 0;}
+.zhihuE_SettingMain input[name=zhihuE_Setting_Checkbox] {cursor: pointer;}
+.zhihuE_SettingMain label {margin-right: 20px;user-select: none;cursor: pointer;vertical-align:middle;}
.zhihuE_SettingMain hr {border: 0.5px solid #f4f4f4;}
[data-theme="dark"] .zhihuE_SettingRoot {color: #adbac7;background-color: #343A44;}
[data-theme="dark"] .zhihuE_SettingHeader {color: #d0d0d0;background-color: #2D333B;}
@@ -150,7 +154,7 @@
if (line) _br = '
'
for (let i=0; i
${menu[i][2]}:${_br}`
+ _html += `${_br}`
} else if (GM_getValue(menu[i][0])) {
_html += `${_br}`
} else {
@@ -160,15 +164,20 @@
_html += `