您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动刷新页面并显示刷新次数和累计刷新次数
// ==UserScript== // @name 爱文的英语 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 自动刷新页面并显示刷新次数和累计刷新次数 // @author You // @match https://teach.sxjgxy.edu.cn/meol/jpk/course/layout/newpage/index.jsp?courseId=12112 // @grant none // ==/UserScript== (function() { 'use strict'; // 设置刷新次数 var refreshCount = 300; // 显示刷新次数和累计刷新次数的元素 var countDisplay = document.createElement('div'); countDisplay.style.position = 'fixed'; countDisplay.style.top = '10px'; countDisplay.style.right = '10px'; countDisplay.style.padding = '5px'; countDisplay.style.background = '#fff'; document.body.appendChild(countDisplay); // 定时刷新页面 var count = 0; var totalCount = 0; var intervalId = setInterval(function() { count++; totalCount++; countDisplay.textContent = '已刷新次数:' + count + ',累计刷新次数:' + totalCount; if (count > refreshCount) { clearInterval(intervalId); } else { location.reload(); } }, 3000); // 刷新间隔,这里设置为3秒 })();