RESI

Bersih-bersih jejak kaki lu JGRP

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         RESI
// @name:en      RESI
// @namespace    http://tampermonkey.net/
// @version      2025-08-15
// @description  Bersih-bersih jejak kaki lu JGRP
// @description:en The script will automatically reset your traces on JGRP
// @author       ibraheem
// @match        https://jogjagamers.org/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=jogjagamers.org
// @grant        none
// @license      MIT
// ==/UserScript==
/* jshint esversion: 8 */

(function() {
    'use strict';

    const toggleBtn = document.createElement('button');
    toggleBtn.title = 'Tampilkan Reset';
    toggleBtn.style.position = 'fixed';
    toggleBtn.style.bottom = '20px';
    toggleBtn.style.right = '20px';
    toggleBtn.style.width = '48px';
    toggleBtn.style.height = '48px';
    toggleBtn.style.backgroundColor = '#2ecc71';
    toggleBtn.style.backgroundImage = 'url("https://www.google.com/s2/favicons?sz=64&domain=jogjagamers.org")';
    toggleBtn.style.backgroundSize = '24px 24px';
    toggleBtn.style.backgroundRepeat = 'no-repeat';
    toggleBtn.style.backgroundPosition = 'center';
    toggleBtn.style.border = 'none';
    toggleBtn.style.borderRadius = '50%';
    toggleBtn.style.cursor = 'pointer';
    toggleBtn.style.zIndex = '9999';
    toggleBtn.style.boxShadow = '0 2px 6px rgba(0,0,0,0.3)';
    toggleBtn.style.opacity = '0.8';
    toggleBtn.style.transition = 'opacity 0.2s, transform 0.3s';
    toggleBtn.onmouseover = () => { toggleBtn.style.opacity = '1'; };
    toggleBtn.onmouseout = () => { toggleBtn.style.opacity = '0.8'; };

    const resetBtn = document.createElement('button');
    resetBtn.innerText = 'Reset';
    resetBtn.style.position = 'fixed';
    resetBtn.style.bottom = '80px';
    resetBtn.style.right = '20px';
    resetBtn.style.padding = '10px 15px';
    resetBtn.style.backgroundColor = '#e74c3c';
    resetBtn.style.color = 'white';
    resetBtn.style.border = 'none';
    resetBtn.style.borderRadius = '8px';
    resetBtn.style.cursor = 'pointer';
    resetBtn.style.zIndex = '9999';
    resetBtn.style.fontSize = '14px';
    resetBtn.style.boxShadow = '0 2px 6px rgba(0,0,0,0.3)';
    resetBtn.style.opacity = '0';
    resetBtn.style.pointerEvents = 'none';
    resetBtn.style.transition = 'opacity 0.3s';

    let visible = false;
    toggleBtn.addEventListener('click', () => {
        visible = !visible;
        if (visible) {
            resetBtn.style.opacity = '1';
            resetBtn.style.pointerEvents = 'auto';
        } else {
            resetBtn.style.opacity = '0';
            resetBtn.style.pointerEvents = 'none';
        }
    });

    resetBtn.addEventListener('click', async () => {
        if (confirm('Reset semua data situs ini?')) {

            document.cookie.split(";").forEach(cookie => {
                const eqPos = cookie.indexOf("=");
                const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
                document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/";
            });

            localStorage.clear();
            sessionStorage.clear();

            if (window.indexedDB) {
                const dbs = await indexedDB.databases();
                dbs.forEach(db => {
                    if (db.name) indexedDB.deleteDatabase(db.name);
                });
            }

            location.reload(true);
        }
    });

    document.body.appendChild(toggleBtn);
    document.body.appendChild(resetBtn);
})();