// ==UserScript== // @name U校园时长工具 // @namespace http://tampermonkey.net/ // @version 0.1.2 // @description awa // @author handsometaoa // @match https://ucontent.unipus.cn/_pc_default/pc.html?cid=* // @grant none // @license GPL-3.0 // @compatible chrome // ==/UserScript== //表示每个页面停留30s,可以自己设置 (function () { setTimeout(function() { setTimeout(window.location.reload()); }, 30000);//指定30秒刷新一次 })(); //自动点击必修弹窗和麦克风弹窗 3000表示延迟3秒,因为弹窗有延迟,主要看反应速度。 setTimeout(() => { var x = document.getElementsByClassName("dialog-header-pc--close-yD7oN"); x[0].click(); document.querySelector("div.dialog-header-pc--dialog-header-2qsXD").parentElement.querySelector('button').click(); }, 3000);//必修提示弹窗延迟3s点击 setTimeout(() => { switch_next('.layoutHeaderStyle--circleTabsBox-jQdMo a', 'selected'); switch_next('#header .TabsBox li', 'active'); switch_next('#sidemenu li.group', 'active'); }, realTime());