您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Make Absolute Time on GreasyFork
当前为
// ==UserScript== // @name Absolute Time on GreasyFork // @namespace UserScript // @match https://greasyfork.org/* // @grant none // @version 1.0.0 // @license MIT // @author CY Fung // @description Make Absolute Time on GreasyFork // @unwrap // ==/UserScript== function pad(s, d){ s= `000000${s}` return s.substring(s.length-d) } let did = 0; let cid = setInterval(()=>{ for(const s of document.querySelectorAll("relative-time[datetime]:not(.absolute)")){ s.classList.add("absolute") s.format = 'datetime'; did ? (cancelAnimationFrame(did), (did=0)) :0; Promise.resolve(s).then(()=>{ did ? (cancelAnimationFrame(did), (did=0)) :0; requestAnimationFrame(()=>{ did ? (cancelAnimationFrame(did), (did=0)) :0; let d = s.getAttribute('datetime'); let dt = d ? new Date(d) : null; if(dt && s.shadowRoot && s.shadowRoot.firstChild){ s.shadowRoot.firstChild.textContent =`${dt.getFullYear()}.${pad(dt.getMonth()+1,2)}.${pad(dt.getDate(),2)} ${pad(dt.getHours(),2)}:${pad(dt.getMinutes(),2)}` } }) }) } did = did || (document.body ? requestAnimationFrame(()=>{ cid && clearInterval(cid); cid = 0; }) : 0); },1)