您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Refresh Tracks when you click on it after a period of inactivity
// ==UserScript== // @name tracks.tra.in refresh // @namespace http://ostermiller.org/ // @version 1.0 // @description Refresh Tracks when you click on it after a period of inactivity // @match http://tracks.tra.in/* // @copyright 2014, Stephen Ostermiller // ==/UserScript== var lastrefresh = new Date().getTime(); window.addEventListener("focus", function(event) { // console.log("tracks has focus"); var age = new Date().getTime() - lastrefresh; // console.log("Age: " + age); if (age > 1000 * 60 * 60 * 4) { // more than four hours old // console.log("Refreshing Tracks"); location.reload(); } }, false);