LUOGU 私信密码锁
如果你不希望自己的私信背偷窥的话加入这个篡改猴代码就可以了初始密码123456有bug欢迎指出// UserScript // name 洛谷私信密码锁-修复校验版 // namespace http://tampermonkey.net/ // version 4.1 // description 私信上锁忘记密码弹窗自定义设置洛谷验证密码初始解锁密码123456底部添加作者信息跳转链接 // author William // match https://www.luogu.com.cn/chat* // grant GM_setValue // grant GM_getValue // run-at document-start // /UserScript (function(){ use strict; const DEFAULT_UNLOCK_PWD 123456; let unlockPwd GM_getValue(luoguChatLockPwd, DEFAULT_UNLOCK_PWD); let luoguVerifyPwd GM_getValue(luoguAccountPwd, ); const maskdocument.createElement(div); mask.styleposition:fixed;top:0;left:0;width:100vw;height:100vh;background:#0a0a0a;z-index:9999999;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;color:#fff;font-size:18px;; const titledocument.createElement(div); title.textContent私信已加密锁定请输入解锁密码; const fakePwddocument.createElement(input); fakePwd.typepassword; fakePwd.styleposition:absolute;opacity:0;width:1px;height:1px;; const inputdocument.createElement(input); input.typepassword; input.autocompletenew-password; input.dataset[1pIgnore]1; input.stylepadding:11px 15px;width:290px;font-size:16px;border:none;border-radius:7px;outline:0;background:#222;color:#fff;; const btnRowdocument.createElement(div); btnRow.styledisplay:flex;gap:12px;; const unlockBtndocument.createElement(button); unlockBtn.textContent解锁查看; unlockBtn.stylepadding:11px 20px;background:#0077ff;color:#fff;border:none;border-radius:7px;font-size:16px;cursor:pointer;; const forgetBtndocument.createElement(button); forgetBtn.textContent忘记密码; forgetBtn.stylepadding:11px 20px;background:#444;color:#fff;border:none;border-radius:7px;font-size:16px;cursor:pointer;; const tipdocument.createElement(div); tip.style.color#ff5555;height:22px; btnRow.append(unlockBtn,forgetBtn); mask.append(fakePwd,title,input,btnRow,tip); // 底部作者信息栏 const footerdocument.createElement(div); footer.styleposition:absolute;bottom:30px;left:0;width:100%;text-align:center;font-size:15px;color:#ffffff;; const linkdocument.createElement(a); link.hrefhttps://www.luogu.com.cn/user/1223232; link.target_blank; link.stylecolor:#88ccff;text-decoration:none;; link.textContent作者WILLIAM 洛谷账号https://www.luogu.com.cn/user/1223232; footer.appendChild(link); mask.appendChild(footer); document.documentElement.appendChild(mask); window.addEventListener(load,()input.value); function checkUnlock(){ if(input.valueunlockPwd){ mask.remove(); }else{ tip.textContent密码错误请重新输入; input.value; } } unlockBtn.onclickcheckUnlock; input.onkeydowne{if(e.keyEnter)checkUnlock();}; forgetBtn.onclick(){ const boxdocument.createElement(div); box.styleposition:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:#181818;padding:24px;border-radius:8px;z-index:10000000;display:flex;flex-direction:column;gap:15px;color:#fff;min-width:320px;; const t1document.createElement(div); t1.textContent输入你的洛谷登录密码用于验证重置; const luoPwdIndocument.createElement(input); luoPwdIn.typepassword; luoPwdIn.placeholder输入洛谷登录密码; luoPwdIn.stylepadding:10px;width:100%;background:#222;color:#fff;border:none;border-radius:6px;outline:none;; luoPwdIn.valueluoguVerifyPwd; const t2document.createElement(div); t2.textContent设置新的私信解锁密码; const newPwdIndocument.createElement(input); newPwdIn.typepassword; newPwdIn.placeholder新解锁密码; newPwdIn.stylepadding:10px;width:100%;background:#222;color:#fff;border:none;border-radius:6px;outline:none;; const btnsdocument.createElement(div); btns.styledisplay:flex;gap:10px;justify-content:flex-end;; const confirmBtndocument.createElement(button); confirmBtn.textContent确认修改; confirmBtn.stylepadding:8px 16px;background:#0077ff;border:none;border-radius:6px;color:#fff;cursor:pointer;; const closeBtndocument.createElement(button); closeBtn.textContent取消; closeBtn.stylepadding:8px 16px;background:#444;border:none;border-radius:6px;color:#fff;cursor:pointer;; const warndocument.createElement(div); warn.style.color#ff5555;font-size:14px;height:18px;; btns.append(confirmBtn,closeBtn); box.append(t1,luoPwdIn,t2,newPwdIn,warn,btns); document.body.appendChild(box); closeBtn.onclick()box.remove(); confirmBtn.onclick(){ const lpluoPwdIn.value.trim(); const npnewPwdIn.value.trim(); if(lp){ warn.textContent请填写洛谷登录密码; return; } if(np){ warn.textContent新密码不能为空; return; } if(lp!luoguVerifyPwd){ if(luoguVerifyPwd){ luoguVerifyPwdlp; GM_setValue(luoguAccountPwd,luoguVerifyPwd); }else{ warn.textContent洛谷密码验证失败; return; } } unlockPwdnp; GM_setValue(luoguChatLockPwd,unlockPwd); warn.style.color#66ff66; warn.textContent修改成功; setTimeout(()box.remove(),1200); }; luoPwdIn.onkeydowne{if(e.keyEnter)confirmBtn.click();}; newPwdIn.onkeydowne{if(e.keyEnter)confirmBtn.click();}; }; })();