// ==UserScript==
// @name 自动页面刷新
// @namespace http://tampermonkey.net/
// @version 1.0
// @Description 使当前页面每5分钟自动刷新一次
// @Author Your Name
// @match http://tampermonkey.net/ // 应用于所有页面;如需针对特定站点,请更改为相应的网址
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 定义定时器,单位为毫秒,此处设置为5分钟(300000毫秒)
const refreshInterval = 30000;
// 刷新页面的函数
function refreshPage() {
console.log("页面正在刷新...");
location.reload(); // 刷新页面
}
// 启动定时器,首次立即执行,之后每5分钟执行一次
setInterval(refreshPage, refreshInterval);
// 可选:如果需要在脚本加载时立即执行一次刷新,取消下一行的注释
// refreshPage();
})();
// @name 自动页面刷新
// @namespace http://tampermonkey.net/
// @version 1.0
// @Description 使当前页面每5分钟自动刷新一次
// @Author Your Name
// @match http://tampermonkey.net/ // 应用于所有页面;如需针对特定站点,请更改为相应的网址
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 定义定时器,单位为毫秒,此处设置为5分钟(300000毫秒)
const refreshInterval = 30000;
// 刷新页面的函数
function refreshPage() {
console.log("页面正在刷新...");
location.reload(); // 刷新页面
}
// 启动定时器,首次立即执行,之后每5分钟执行一次
setInterval(refreshPage, refreshInterval);
// 可选:如果需要在脚本加载时立即执行一次刷新,取消下一行的注释
// refreshPage();
})();