|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 蓝奏云网盘增强 |
3 | | -// @version 1.5.0 |
| 3 | +// @version 1.5.1 |
4 | 4 | // @author X.I.U |
5 | 5 | // @description 文件排序、刷新不回根目录、快捷返回上一级(右键网页空白处)、后退返回上一级、右键文件显示菜单、点击直接下载文件、点击空白进入目录、自动显示更多文件、一键复制所有分享链接、自定义分享链接域名、自动打开/复制分享链接、带密码的分享链接自动输密码、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 |
6 | 6 | // @match *://lanzou.com/u |
|
293 | 293 | if (!menu_value('menu_directDownload')) return |
294 | 294 | if (document.getElementById('infos')) { |
295 | 295 | document.getElementById('infos').addEventListener('click', function(e) { |
296 | | - if (e.target.tagName === 'A') { |
| 296 | + if (e.target.tagName === 'A') { // 针对普通样式的分享链接列表页 |
297 | 297 | e.preventDefault(); // 阻止默认打开链接事件 |
298 | 298 | GM_openInTab(e.target.href + '#download', {active: false, insert: true, setParent: true}); // 后台打开 |
| 299 | + } else { // 针对会员专属样式的分享链接列表页 |
| 300 | + const link = e.target.closest('a'); // 点击 <a> 元素的子元素时,寻找最近的 <a> 父元素 |
| 301 | + if ((link && this.contains(link))) { |
| 302 | + e.preventDefault(); // 阻止默认打开链接事件 |
| 303 | + GM_openInTab(link.href + '#download', {active: false, insert: true, setParent: true}); // 后台打开 |
| 304 | + } |
299 | 305 | } |
300 | 306 | }); |
301 | 307 | } |
|
304 | 310 | function directDownload_() { |
305 | 311 | if (!menu_value('menu_directDownload')) return |
306 | 312 | if (location.hash != '#download') return |
307 | | - let iframe = document.querySelector('iframe.ifr2'); |
| 313 | + let iframe = document.querySelector('iframe.ifr2, iframe.n_downlink'); |
308 | 314 | if (iframe) { // 只有找到 iframe 框架时才会继续运行脚本 |
309 | 315 | iframe = iframe.contentWindow; |
310 | 316 | let timer = setInterval(function(){ |
|
0 commit comments