delete-security-code

解除北科的驗證碼

  1. // ==UserScript==
  2. // @name delete-security-code
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1.2
  5. // @description 解除北科的驗證碼
  6. // @author onon1101
  7. // @license MIT
  8. // @match https://nportal.ntut.edu.tw/index.do*
  9. // @match https://nportal.ntut.edu.tw/login.do
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=edu.tw
  11. // @grant none
  12. // @require https://cdnjs.cloudflare.com/ajax/libs/qs/6.11.2/qs.min.js
  13. // @require http://ajax.googleapis.com/ajax/libs/dojo/1.17.3/dojo/dojo.js
  14. // ==/UserScript==
  15.  
  16. (function () {
  17. 'use strict';
  18. console.log('start');
  19. })();
  20.  
  21. if (location.href === 'https://nportal.ntut.edu.tw/login.do') {
  22. document.getElementsByTagName("font")[0].remove;
  23. const errorMsg = document.getElementsByTagName("center")[0].innerText.split('\n')[7];
  24. if (errorMsg === '「驗證碼」輸入錯誤,請重新輸入。') {
  25. document.getElementsByTagName("body")[0].remove();
  26. // document.getElementsByClassName("vsc-initialized")[0].remove();
  27. location.reload();
  28. }
  29. return ;
  30. }
  31.  
  32. window.login1 = function login1() {
  33. document.getElementById('mpassword').type = 'password';
  34. document.getElementById('eyes').src = 'images/pwdhide.png';
  35. var thisform = document.login;
  36. var encodePwd = "{ENCODE}" + dojox.encoding.crypto.Blowfish.encrypt(thisform.mpassword.value, thisform.muid.value.toLowerCase());
  37. thisform.mpassword.value = encodePwd;
  38. thisform.submit();
  39. }
  40.  
  41. document.getElementById("authcode").remove();
  42. document.getElementsByClassName("authcode co")[0].remove();
  43. document.getElementsByClassName("title")[2].remove();
  44.  
  45. let styleElement = document.createElement("style");
  46. styleElement.type = "text/css";
  47. styleElement.innerText = ".notifyjs-bootstrap-base {width: 200px;float: left;margin: 10px 0 0 10px;text-align: left;font-size: 16px;}";
  48. document.getElementById("wrap").appendChild(styleElement);