Skip to content

Commit 1cb4079

Browse files
committed
优化 [点击直接下载文件] 功能
1 parent 3c192db commit 1cb4079

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

Lanzou-Enhanced.user.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 蓝奏云网盘增强
3-
// @version 1.4.1
3+
// @version 1.4.2
44
// @author X.I.U
55
// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、点击直接下载文件、点击空白进入目录、自动显示更多文件、一键复制所有分享链接、自定义分享链接域名、自动打开/复制分享链接、带密码的分享链接自动输密码、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小
66
// @include /^https:\/\/.+\.lanzou[a-z]\.com\/.*$/
@@ -284,11 +284,16 @@
284284
iframe = iframe.contentWindow;
285285
let timer = setInterval(function(){
286286
if (iframe.document.querySelector('#go a[href]')) {
287-
iframe.document.querySelector('#go a[href]').target = '_top'
288-
iframe.document.querySelector('#go a[href]').click();
289-
//GM_openInTab(iframe.document.querySelector('#go a[href]').href, {active: false, insert: true, setParent: false}); // 后台打开
287+
//iframe.document.querySelector('#go a[href]').target = '_top'
288+
//iframe.document.querySelector('#go a[href]').click();
289+
GM_openInTab(iframe.document.querySelector('#go a[href]').href, {active: false, insert: true, setParent: false}); // 后台打开
290290
clearInterval(timer);
291-
setTimeout(function(){window.top.close();},200)// 关闭该后台标签页
291+
// 关闭该后台标签页
292+
if (GM_info.scriptHandler === 'Violentmonkey') { // Violentmonkey 需要延迟一会儿
293+
setTimeout(function(){window.top.close();}, 500)
294+
} else {
295+
window.top.close();
296+
}
292297
}
293298
}, 10);
294299
}

0 commit comments

Comments
 (0)