Time Local Display (Main PC)

Показывает московское время только в главном окне, в правом нижнем углу, без повторов в iframe и всплывающих окнах.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Time Local Display (Main PC)
// @namespace    http://tampermonkey.net/
// @version      1.59
// @description  Показывает московское время только в главном окне, в правом нижнем углу, без повторов в iframe и всплывающих окнах.
// @author       Your Name
// @match        *://*/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Не выполняем скрипт во фреймах или всплывающих окнах
    if (window.top !== window.self) return;

    const timeDisplay = document.createElement('div');

    Object.assign(timeDisplay.style, {
        position: 'fixed',
        right: '20px',
        bottom: '20px',
        backgroundColor: 'rgba(0, 0, 0, 0.8)',
        color: 'white',
        padding: '10px',
        borderRadius: '8px',
        fontFamily: 'monospace',
        fontSize: '14px',
        boxShadow: '0 0 12px rgba(0, 0, 0, 0.5)',
        zIndex: '999999',
        pointerEvents: 'none',
        textAlign: 'center',
        minWidth: '180px'
    });

    document.body.appendChild(timeDisplay);

    function updateTime() {
        const now = new Date();
        const options = {
            timeZone: 'Europe/Moscow',
            hour: '2-digit',
            minute: '2-digit',
            second: '2-digit',
            year: 'numeric',
            month: '2-digit',
            day: '2-digit'
        };
        const moscowTime = now.toLocaleString('ru-RU', options).replace(',', ' -');
        timeDisplay.innerText = `${moscowTime}`;
    }

    updateTime();
    setInterval(updateTime, 1000);
})();