Gartic.io Cookie Cleaner

Deletes specific cookies when the exit button is clicked on Gartic.io

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Gartic.io Cookie Cleaner
// @name:tr      Gartic.io Çerez Temizleyici
// @namespace    http://tampermonkey.net/
// @version      2025-04-19
// @description  Deletes specific cookies when the exit button is clicked on Gartic.io
// @description:tr  Gartic.io'da çıkış düğmesine tıklandığında belirli çerezleri siler
// @author       anonimbiri
// @match        *://gartic.io/*
// @icon         https://raw.githubusercontent.com/Gartic-Developers/Kawaii-Helper/refs/heads/main/Assets/kawaii-logo.png
// @grant        GM_cookie
// @noframes
// ==/UserScript==

(function() {
    'use strict';

    // Havalı neon-mor konsol log stili
    const cyberAnimeLog = (message, isError = false) => {
        const style = `
            background: linear-gradient(90deg, #6a00ff, #ff00ff);
            color: ${isError ? '#ff4d4d' : '#e0e0ff'};
            padding: 10px 15px;
            border-radius: 5px;
            font-family: 'Courier New', monospace;
            font-size: 13px;
            font-weight: bold;
            text-shadow: 0 0 8px #ff00ff, 0 0 12px #6a00ff;
            box-shadow: 0 0 15px #ff00ff;
            border: 1px solid #ff00ff;
        `;
        console.log(`%c🌌 ${message} ⚡️`, style);
    };

    // Function to delete a cookie
    function deleteCookie(name) {
        GM_cookie.delete({ name: name }, function(error) {
            if (error) {
                cyberAnimeLog(`✖ ${name} çerezi silinirken hata oluştu!`, true);
            } else {
                cyberAnimeLog(`✔ ${name} çerezi başarıyla silindi!`);
            }
        });
    }

    // Exit butonunu bul ve click event ekle
    function setupExitButton() {
        const exitButton = document.getElementById('exit');
        if (exitButton) {
            exitButton.addEventListener('click', function() {
                cyberAnimeLog('Çerez avı başladı! 🔫');
                deleteCookie('garticio');
                deleteCookie('cf_clearance');
            });
            cyberAnimeLog('Exit butonu bulundu ve hazır! 🎮');
            return true;
        }
        return false;
    }

    // İlk deneme
    if (!setupExitButton()) {
        cyberAnimeLog('Exit butonu henüz yüklenmedi, gözetliyorum... 👾', true);

        // MutationObserver ile butonun yüklenmesini izle
        const observer = new MutationObserver((mutations, obs) => {
            if (setupExitButton()) {
                obs.disconnect(); // Buton bulundu, izlemeyi bırak
            }
        });

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

    deleteCookie('garticio');
    deleteCookie('cf_clearance');
})();