您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
广东省专用
当前为
// ==UserScript== // @name 广东省国家工作人员学法考试系统自动刷课 // @namespace http://tampermonkey.net/ // @version 2023.7.5.001 // @description 广东省专用 // @author yygdz1921 // @match http*://xfks-study.gdsf.gov.cn/study/* // @icon https://www.google.com/s2/favicons?sz=64&domain=gdsf.gov.cn // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; // Your code here... var log = console.log; function main() { var pathname = window.location.pathname; if (pathname.includes("index")) { log("index..."); var cols = document.getElementsByClassName("column"); for (let index = 0; index < cols.length; index++) { var col = cols[index]; var catalogdesc = col.getAttribute("catalogdesc"); var course = col.querySelector(".card.current").innerText.replace(/\s+/g, ""); if (catalogdesc.includes("庭审") || catalogdesc.includes("题库")) { continue; } // 判断是否完成 var btn = col.getElementsByClassName("btn")[0]; if (btn) { log("未完成", col); btn.click(); break; } else { log(catalogdesc, course); } } } else if (pathname.includes("chapter")) { log("chapter..."); var ms = 3000 + Math.floor(Math.random() * 1000); submitLearn(); setTimeout(() => { var next_chapter = document.querySelector(".next_chapter") if (next_chapter) { next_chapter.click(); } else { window.location.pathname = "study/index"; } }, ms); } else if (pathname.includes("course")) { log("course..."); var finish = true; var lis = document.getElementsByClassName("chapter")[0].getElementsByTagName("li"); for (let index = 0; index < lis.length; index++) { var li = lis[index]; var sub_title = li.getElementsByClassName("sub_title")[0].innerText; if (sub_title.includes("获得") || sub_title.includes("未开放")) { continue; } finish = false; li.querySelector(".title a").click(); break; } if (finish) { document.querySelector(".menu-ic-note").click(); } } else if (pathname.includes("login")) { log("login...") } else { log("未知页面", pathname); } } window.onload = main; })();