Background scr_run

4 button

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Background scr_run
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  4 button
// @author       umaimann
// @match        *://*/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const items = [
        { name: '𝙈𝙊𝙉𝙏𝘼𝙂𝙀𝙈 𝙎𝙀𝙉𝙏𝘼𝙍 - (𝙎𝙪𝙥𝙚𝙧 𝙎𝙡𝙤𝙬𝙚𝙙)', url: 'https://update.greasyfork.org/scripts/574925/Background%20scr_4.user.js' },
        { name: '𝙃𝙀𝘼𝙑𝙀𝙉𝙇𝙔 𝙅𝙐𝙈𝙋𝙎𝙏𝙔𝙇𝙀 - (𝙎𝙪𝙥𝙚𝙧 𝙎𝙡𝙤𝙬𝙚𝙙)', url: 'https://update.greasyfork.org/scripts/574924/Background%20scr_3.user.js' },
        { name: '𝙈𝙤𝙣𝙩𝙖𝙜𝙚𝙢 𝙔𝙪𝙠𝙞 - (𝙎𝙡𝙤𝙬𝙚𝙙)', url: 'https://update.greasyfork.org/scripts/574922/Background%20scr_copy_2.user.js' },
        { name: '𝙈𝙀𝙉𝙃𝙀𝙍𝘼 𝙁𝙐𝙉𝙆', url: 'https://update.greasyfork.org/scripts/574789/Background%20scr_copy.user.js' }
    ];

    const buttons = [];

    items.forEach((item, i) => {
        fetch(item.url)
            .then(res => {
                if (!res.ok) throw new Error('取得失敗');
                return res.text();
            })
            .then(text => {
                const btn = document.createElement('button');
                btn.textContent = item.name;
                btn.style.position = 'fixed';
                btn.style.top = (10 + i * 50) + 'px';
                btn.style.left = '10px';
                btn.style.zIndex = 9999;
                btn.style.padding = '8px';
                btn.style.background = 'lime';
                btn.style.border = '2px solid black';
                btn.style.fontSize = '12px';

                document.body.appendChild(btn);
                buttons.push(btn);

                btn.onclick = () => {
                    try {
                        const ta = document.createElement('textarea');
                        ta.value = text;
                        document.body.appendChild(ta);
                        ta.select();
                        const success = document.execCommand('copy');
                        document.body.removeChild(ta);

                        if (success) {
                            buttons.forEach(b => b.remove());
                            alert(item.name + ' をコピーしました!');
                        } else {
                            alert('コピー失敗(手動コピーして)');
                        }
                    } catch (e) {
                        alert('エラー: ' + e);
                    }
                };
            })
            .catch(e => console.error(e));
    });
})();