您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Intelligently refreshes web pages only when content changes - no configuration needed
当前为
// ==UserScript== // @name Smart Page Auto Refresh // @namespace http://tampermonkey.net/ // @version 1.1 // @description Intelligently refreshes web pages only when content changes - no configuration needed // @author kequn yang // @match *://* // @match file:///* // @grant none // @run-at document-end // @license MIT // ==/UserScript== (function() { 'use strict'; let lastContent = ''; const REFRESH_INTERVAL = 1000; function getCurrentContent(html) { const tempDiv = document.createElement('div'); tempDiv.innerHTML = html; return tempDiv.innerHTML; } function hasContentChanged(newContent) { const changed = lastContent !== newContent; lastContent = newContent; return changed; } async function checkAndRefresh() { try { const response = await fetch(window.location.href); const text = await response.text(); const newContent = getCurrentContent(text); if (hasContentChanged(newContent)) { const tempDiv = document.createElement('div'); tempDiv.innerHTML = text; document.body.innerHTML = tempDiv.body.innerHTML; } } catch (error) { // Silent fail - no refresh on error } } function setupAutoRefresh() { lastContent = document.body.innerHTML; setInterval(checkAndRefresh, REFRESH_INTERVAL); } setupAutoRefresh(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址