// ==UserScript== // @name 果壳选课优化 // @namespace https://jwxk.ucas.ac.cn/ // @version 0.1 // @description 优化果壳选课界面 // @author You // @include *//jwxk.ucas.ac.cn/courseManage/* // @icon https://www.google.com/s2/favicons?sz=64&domain=ucas.ac.cn // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; function hideFullCourse() { let body = document.querySelector("#regfrm > table > tbody") if (body === null) { return } for (let i = 0; i < body.childElementCount; i++) { let node = body.children[i] if (node.firstElementChild.firstElementChild.disabled) { node.style.display = "none" } } } function showEnglishCourseButton() { let box = document.querySelector("#regfrm2 > div:nth-child(9)") if (box === null) { return } let button = document.createElement('button') button.id = 'go-english-btn' button.innerHTML = '跳转英语课' button.setAttribute('class', 'btn btn-primary') button.setAttribute('type', 'submit') button.onclick = function() { document.querySelector("#id_915").checked = true document.querySelector("#regfrm2 > div:nth-child(9) > button").click() } box.appendChild(button) } function start() { console.log('start') hideFullCourse() showEnglishCourseButton() } setTimeout(start, 100) })();