content-script

账号登录(不可用)

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/445276/1052240/content-script.js

  1. // ==UserScript==
  2. // @name content-script
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 账号登录(不可用)
  6. // @author hzane
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. document.addEventListener('DOMContentLoaded', function()//当初始的 HTML 文档被完全加载和解析完成之后,DOMContentLoaded 事件被触发,而无需等待样式表、图像和子框架的完全加载
  11. {
  12. var ZHtemp='';
  13. var MMtemp='';
  14. var jsonData;
  15. var len;
  16. function drzh() {
  17. jsonData = JSON.parse(GM_getValue('zhPass'));//JSON.parse() 方法用于将一个 JSON 字符串转换为对象
  18. len = jsonData.length;
  19. console.log(jsonData);
  20. var localUrl = window.location.href;
  21. if(localUrl == "https://www.2-class.com/"){
  22. function writeZH(){
  23. document.getElementById('account').setAttribute('value',ZHtemp);
  24. document.getElementById('account').value=ZHtemp;
  25. console.log(ZHtemp);
  26. }
  27. function writeMM(){
  28. console.log(MMtemp);
  29. document.getElementById('password').setAttribute('value',MMtemp);
  30. document.getElementById('password').value=MMtemp;
  31. }
  32. for(var i=0; i<len;i++){
  33. if(!jsonData[i]['成绩'] || jsonData[i]['成绩'] == ' '){
  34. ZHtemp = jsonData[i]['账号'];
  35. //console.log("账号"+jsonData[i]['账号']);
  36. MMtemp = jsonData[i]['密码'];
  37. break;
  38. }
  39. }
  40. if(i== len){
  41. alert("所有学生已完成知识竞赛,请登录(不可用)班主任或管理员账号查看!")
  42. }
  43. document.onclick = function(){
  44. if(event.srcElement.getAttribute('id') == 'account'){
  45. writeZH();
  46. }
  47. else if(event.srcElement.getAttribute('id') == 'password'){
  48. writeMM();
  49. }else if(event.srcElement.getAttribute('type') == 'submit'){
  50. for(var i=0; i<len;i++){
  51. if(jsonData[i]['账号'] == ZHtemp){
  52. jsonData[i]['成绩'] = '100';
  53. GM_setValue('zhPass', JSON.stringify(jsonData));
  54. }
  55. }
  56. }
  57. }
  58. }
  59. };
  60. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址