GC Add Volcano Plot Link

Adds a link to the volcano plot page on the Battledome Page

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         GC Add Volcano Plot Link
// @namespace     https://greasyfork.org/en/users/1291562-zarotrox
// @version      0.2
// @description  Adds a link to the volcano plot page on the Battledome Page
// @author       Zarotrox
// @icon         https://i.ibb.co/44SS6xZ/Zarotrox.png
// @match        https://www.grundos.cafe/dome/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    
    function addLink() {
       
        var nav = document.querySelector('nav.center.margin-1[aria-label="Battledome Links"]');

        if (nav) {
            
            if (!nav.querySelector('a[href="https://www.grundos.cafe/dome/1p/select/?plot=volcano"]')) {
                
                var newLink = document.createElement('a');
                newLink.href = 'https://www.grundos.cafe/dome/1p/select/?plot=volcano'; // URL of the page you want to link to
                newLink.textContent = 'Volcano Plot'; // Text for the link
                newLink.style.marginLeft = '10px'; // Add margin to separate from other links
                newLink.style.textDecoration = 'none'; // Optional: remove underline

               
                nav.appendChild(newLink);
            }
        } else {
            console.log('Navigation bar not found.');
        }
    }

    
    setTimeout(addLink, 1); // Adjust delay as needed

    // Optional: Observe changes to the document and try adding the link again if necessary
    const observer = new MutationObserver((mutationsList) => {
        for (let mutation of mutationsList) {
            if (mutation.type === 'childList') {
                addLink();
            }
        }
    });

    
    observer.observe(document.body, { childList: true, subtree: true });

})();