Greasy Fork is available in English.

IsMyTeam Admin Button

Adds admin button only on sign-in pages

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

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

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

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

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

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

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

Advertisement:

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

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

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

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

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

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

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

Advertisement:

// ==UserScript==
// @name         IsMyTeam Admin Button
// @namespace    http://tampermonkey.net/
// @version      1.4
// @description  Adds admin button only on sign-in pages
// @match        *://*/*
// @license      MIT
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const BUTTON_ID = 'ismyteam-admin-support-button';

    function isSignInPath() {
        const pathParts = window.location.pathname
            .split('/')
            .filter(Boolean)
            .map((part) => part.toLowerCase());

        return pathParts.includes('sign-in');
    }

    function addButton() {
        if (!document.body) {
            return;
        }

        if (!isSignInPath()) {
            document.getElementById(BUTTON_ID)?.remove();
            return;
        }

        if (document.getElementById(BUTTON_ID)) {
            return;
        }

        const button = document.createElement('a');
        button.id = BUTTON_ID;
        button.textContent = 'admin';
        button.href = `${window.location.origin}/admin-support`;

        Object.assign(button.style, {
            position: 'fixed',
            top: '20px',
            left: '20px',
            zIndex: '2147483647',
            padding: '10px 16px',
            background: '#111827',
            color: '#ffffff',
            fontSize: '14px',
            fontFamily: 'Arial, sans-serif',
            fontWeight: '600',
            textDecoration: 'none',
            borderRadius: '8px',
            boxShadow: '0 4px 12px rgba(0, 0, 0, 0.25)',
            cursor: 'pointer'
        });

        document.body.appendChild(button);
    }

    function start() {
        addButton();

        const observer = new MutationObserver(addButton);
        observer.observe(document.documentElement, {
            childList: true,
            subtree: true
        });

        setInterval(addButton, 1000);
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', start);
    } else {
        start();
    }
})();