From 8ca1be613a52576f8699bd4cefc859aaf1595d37 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 2 Apr 2021 12:51:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E5=90=8E=E5=9B=9E=E8=BD=A6=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?]=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lanzou-Enhanced.user.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Lanzou-Enhanced.user.js b/Lanzou-Enhanced.user.js index 2c7a232..7d81572 100644 --- a/Lanzou-Enhanced.user.js +++ b/Lanzou-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 蓝奏云网盘增强 -// @version 1.2.2 +// @version 1.2.3 // @author X.I.U -// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、调整描述(话说)编辑框初始大小 +// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、自动显示更多文件、自动打开分享链接、自动复制分享链接、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 // @match *://*.lanzous.com/* // @match *://*.lanzoux.com/* // @match *://*.lanzoui.com/* @@ -82,12 +82,15 @@ } - if(document.getElementById("infos")){ // 分享链接文件列表页 + if (document.getElementById("infos")) { // 分享链接文件列表页 + if (document.getElementById("pwdload")) { // 分享链接输入密码页 + enterToPass(); // 输入密码后回车确认 + } setTimeout(fileMoreS, 300); // 自动显示更多文件 - }else if(document.querySelector("iframe.ifr2")){ // 分享链接文件下载页(暂时没有这方面的功能,先空着) + } else if (document.querySelector("iframe.ifr2")) { // 分享链接文件下载页(暂时没有这方面的功能,先空着) //console.log() - }else if(document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1){ // 后台页 - if(window.top.location.href != "https://pc.woozooo.com/mydisk.php"){ + } else if (document.getElementById("mainframe") || window.top.location.href.indexOf("mydisk.php?") > -1) { // 后台页 + if (window.top.location.href != "https://pc.woozooo.com/mydisk.php") { window.top.location.href = "https://pc.woozooo.com/mydisk.php" } var mainframe; @@ -326,6 +329,16 @@ } + // 输入密码后回车确认 + function enterToPass() { + document.getElementById('pwd').onkeydown = function(e){ + if(e.keyCode == 13){ + document.getElementById('sub').click(); + } + }; + } + + // 定时执行(旧方法,每隔 100ms 执行一次,比较笨且浪费一丢丢性能,但优点是不会漏掉且反应更快) //setInterval(fileMore,100);