Time Local Display (Main PC)

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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);
})();