ReloadAtTime

Execute your program at a specific time

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         ReloadAtTime
// @namespace    http://tampermonkey.net/
// @version      1.4
// @description  Execute your program at a specific time
// @author       MeGaBOuSsOl
// @match        *://*
// ==/UserScript==

(function() {
    'use strict';

    // Définir l'heure cible (15:47:04)
    const targetHour = 15;
    const targetMinute = 47;
    const targetSecond = 4;

    // Fonction pour vérifier si l'heure actuelle correspond à l'heure cible
    function checkTime() {
        const now = new Date();
        const targetTime = new Date(
            Date.UTC(
                now.getUTCFullYear(),
                now.getUTCMonth(),
                now.getUTCDate(),
                targetHour,
                targetMinute,
                targetSecond
            )
        );

        // Si l'heure actuelle est égale ou dépasse l'heure cible, recharger la page
        if (now >= targetTime) {
            window.location.reload();
        }
    }

    // Vérifier l'heure toutes les secondes
    const interval = setInterval(checkTime, 1000);

    // Arrêter l'intervalle une fois que l'heure cible est atteinte
    setTimeout(() => {
        clearInterval(interval);
    }, (targetHour * 3600 + targetMinute * 60 + targetSecond) * 1000);
})();