Kaisar Mining Token Extractor with Copy Button

Extract the mining token

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Kaisar Mining Token Extractor with Copy Button
// @namespace    https://zero.kaisar.io
// @version      1.1
// @description  Extract the mining token 
// @author       forestarmy
// @license      MIT
// @match        https://zero.kaisar.io/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const COOKIE_NAME = "kaisar_minning_token";
    const cookie = document.cookie.split('; ').find(row => row.startsWith(COOKIE_NAME + '='));
    if (!cookie) return console.warn("❌ Token not found in cookies.");

    const token = decodeURIComponent(cookie.split('=')[1]);

    // Create container
    const container = document.createElement('div');
    container.style.position = 'fixed';
    container.style.bottom = '20px';
    container.style.right = '20px';
    container.style.padding = '12px';
    container.style.backgroundColor = '#111';
    container.style.color = '#0f0';
    container.style.border = '2px solid #0f0';
    container.style.borderRadius = '8px';
    container.style.zIndex = '9999';
    container.style.fontFamily = 'monospace';
    container.style.fontSize = '13px';
    container.style.maxWidth = '350px';

    // Token display
    const tokenText = document.createElement('div');
    tokenText.innerText = '🔐 Kaisar Mining Token:\n' + token;
    tokenText.style.wordBreak = 'break-word';
    container.appendChild(tokenText);

    // Copy button
    const copyBtn = document.createElement('button');
    copyBtn.innerText = '📋 Copy Token';
    copyBtn.style.marginTop = '10px';
    copyBtn.style.padding = '6px 12px';
    copyBtn.style.backgroundColor = '#0f0';
    copyBtn.style.color = '#000';
    copyBtn.style.border = 'none';
    copyBtn.style.cursor = 'pointer';
    copyBtn.style.borderRadius = '4px';

    copyBtn.onclick = () => {
        navigator.clipboard.writeText(token).then(() => {
            copyBtn.innerText = '✅ Copied!';
            setTimeout(() => (copyBtn.innerText = '📋 Copy Token'), 2000);
        });
    };

    container.appendChild(copyBtn);
    document.body.appendChild(container);
})();