Minimal Page Timer

Adds a minimal timer to webpages

当前为 2025-06-14 提交的版本,查看 最新版本

// ==UserScript==
// @name         Minimal Page Timer
// @description  Adds a minimal timer to webpages
// @match        *://*/*
// @version 0.0.1.20250614102938
// @namespace https://gf.qytechs.cn/users/1435046
// ==/UserScript==

(function () {
    'use strict';

    const timerDiv = document.createElement('div');
    timerDiv.style.position = 'fixed';
    timerDiv.style.top = '10px';
    timerDiv.style.right = '10px';
    timerDiv.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
    timerDiv.style.color = 'white';
    timerDiv.style.fontFamily = 'monospace';
    timerDiv.style.fontSize = '14px';
    timerDiv.style.padding = '4px 8px';
    timerDiv.style.borderRadius = '4px';
    timerDiv.style.zIndex = '9999';
    timerDiv.textContent = '00:00:00';
    document.body.appendChild(timerDiv);

    let seconds = 0;
    setInterval(() => {
        seconds++;
        const h = String(Math.floor(seconds / 3600)).padStart(2, '0');
        const m = String(Math.floor((seconds % 3600) / 60)).padStart(2, '0');
        const s = String(seconds % 60).padStart(2, '0');
        timerDiv.textContent = `${h}:${m}:${s}`;
    }, 1000);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址