在网上搜索了一个网页自动刷新的脚本,但是不运行是什么原因?
tampermonkey吧
全部回复
仅看楼主
level 1
// ==UserScript==
// @name 自动页面刷新
// @namespace http://tampermonkey.net/
// @贴吧用户_00JG4KJ615 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();
})();
2024年05月05日 01点05分 1
level 7
match 那里还是指定了网址
2024年05月11日 10点05分 2
1