Skip to content

Commit 9c6c443

Browse files
committed
新增 [自动显示更多文件] 支持分享链接文件列表页
1 parent 07db059 commit 9c6c443

2 files changed

Lines changed: 36 additions & 14 deletions

File tree

Lanzou-Enhanced.user.js

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// ==UserScript==
22
// @name 蓝奏云网盘增强
3-
// @version 1.0.6
3+
// @version 1.0.7
44
// @author X.I.U
5-
// @description 刷新不返回根目录(F5)、自动显示更多文件(文件夹末尾按钮)、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时)
5+
// @description 刷新不返回根目录(F5)、自动显示更多文件、自动打开分享链接(点击文件时)、自动复制分享链接(点击文件时)
6+
// @match *://*.lanzous.com/*
7+
// @match *://*.lanzoux.com/*
8+
// @match *://*.lanzoui.com/*
69
// @match *://www.lanzou.com/account.php
710
// @match *://www.lanzou.com/u
811
// @match *://up.woozooo.com/u
@@ -23,10 +26,6 @@
2326
// @namespace https://github.com/XIU2/UserScript
2427
// ==/UserScript==
2528
(function() {
26-
if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){
27-
window.top.location.href = "https://pc.woozooo.com/mydisk.php"
28-
}
29-
3029
var menu_open_fileSha = GM_getValue('xiu2_menu_open_fileSha');
3130
var menu_copy_fileSha = GM_getValue('xiu2_menu_copy_fileSha');
3231
var menu_refreshCorrection = GM_getValue('xiu2_menu_refreshCorrection');
@@ -78,15 +77,29 @@
7877
};
7978

8079

80+
if(document.getElementById("infos")){ // 分享链接文件列表页
81+
setTimeout(fileMoreS, 300); // 自动显示更多文件
82+
}else if(document.querySelector("iframe.ifr2")){ // 分享链接文件下载页(暂时没有这方面的功能,先空着)
83+
//console.log()
84+
}else if(document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1){ // 后台页
85+
if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){
86+
window.top.location.href = "https://pc.woozooo.com/mydisk.php"
87+
}
88+
var mainframe;
89+
iframe();
90+
}
91+
92+
8193
// 获取 iframe 框架
82-
var mainframe
83-
mainframe = document.getElementById("mainframe");
84-
if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本
85-
mainframe = mainframe.contentWindow;
86-
if(menu_refreshCorrection){
87-
refreshCorrection(); // 刷新不返回根目录(F5)
94+
function iframe() {
95+
mainframe = document.getElementById("mainframe");
96+
if(mainframe){ // 只有找到 iframe 框架时才会继续运行脚本
97+
mainframe = mainframe.contentWindow;
98+
if(menu_refreshCorrection){
99+
refreshCorrection(); // 刷新不返回根目录(F5)
100+
}
101+
EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件]
88102
}
89-
EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件]
90103
}
91104

92105

@@ -132,6 +145,15 @@
132145
}
133146

134147

148+
// 自动显示更多文件
149+
function fileMoreS() {
150+
let filemore = document.getElementById("filemore"); // 寻找 [显示更多文件] 按钮
151+
if(filemore && filemore.style.display != "none"){ // 判断按钮是否存在且可见
152+
filemore.click(); // 点击 [显示更多文件] 按钮
153+
}
154+
}
155+
156+
135157
// 分享链接相关(点击文件时)
136158
function fileSha() {
137159
var f_sha = mainframe.document.getElementById("f_sha"); // 寻找分享链接(下载链接)信息框

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
| **3DM论坛 美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/zh-CN/scripts/413593)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Beautification.user.js)** |
2323
| **3DM论坛 增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** |
2424
| **423Down 增强 \*** | 自动无缝翻页 | **[「安装」](https://greasyfork.org/zh-CN/scripts/419215)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/423Down-Enhanced.user.js)** |
25-
| **蓝奏云网盘 增强 \*** | 刷新不回根目录、自动显示更多文件、自动打开分享链接... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** |
25+
| **蓝奏云网盘 增强 \*** | 刷新不回根目录、自动显示更多文件、自动复制分享链接... | **[「安装」](https://greasyfork.org/zh-CN/scripts/419224)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Lanzou-Enhanced.user.js)** |
2626
| **智友邦论坛 美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/zh-CN/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** |
2727
| **智友邦论坛 增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子... | **[「安装」](https://greasyfork.org/zh-CN/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** |
2828
| ~~_**Google 翻译 美化**_~~ | ~~_精简多余内容、修复翻译结果溢出屏幕问题_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ | ~~_**[「安装」](https://zhuanlan.zhihu.com/p/286815739)**_~~ |

0 commit comments

Comments
 (0)