您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动填写、勾选单选框、定时刷新,并提交表单
// ==UserScript== // @name 电子科技大学深圳高等研究院校园网自动重置 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 自动填写、勾选单选框、定时刷新,并提交表单 // @author zjl // @match http://2.2.2.3/* // @match https://www.msn.cn/zh-cn // @grant none // @license MIT // ==/UserScript== (function() { // input1.value = "*****"; // input2.value = "****"; 'use strict'; if(window.location.href.match(/www.msn.cn\/zh-cn/) != null) window.location.href = 'http://2.2.2.3' // 定时刷新时间间隔,单位为毫秒(例如,60000表示每60秒 * 30 刷新一次) var refreshInterval = 60000 * 30; // 填写输入框并勾选单选框的函数 function fillForm() { // 请根据实际情况调整选择器 var input1 = document.querySelector('input[id="password_name"]'); var input2 = document.querySelector('input[id="password_pwd"]'); var radioButton = document.querySelector('input[type="checkbox"][id="password_disclaimer"]'); if (input1) { input1.value = "your_acount"; } if (input2) { input2.value = "your_pwd"; } if (radioButton) { radioButton.checked = true; } } // 提交表单的函数 function submitForm() { // 请根据实际情况调整选择器 var button = document.getElementById('password_submitBtn'); button.click(); } 2 // 使用Axios发送数据的函数 async function getIfDisconnected() { console.log("心跳检测"); return axios.post('http://2.2.2.3/homepage/info.php?opr=list') .then((res)=>{ return res.data.success }) .catch((err)=>{ console.log(err); }); } // 每次页面加载时执行一次填写输入框、勾选单选框和提交表单的操作s function repeat() { getIfDisconnected().then((res)=>{ if(!res){ if(window.location.href.match(/ac_portal/) == null) { window.open('http://2.2.2.3') window.close() } fillForm(); submitForm(); } }) return repeat } // 设置定时刷新 setInterval(repeat(), refreshInterval); })();