Blooket KGui Loader

A loader for the Blooket Council's KGui

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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        Blooket KGui Loader
// @description A loader for the Blooket Council's KGui
// @namespace   https://github.com/c0des1ayr
// @match       *://*.blooket.com/play*
// @exclude     *://play.blooket.com/play*
// @icon        https://play.blooket.com/favicon.ico
// @grant       GM.xmlHttpRequest
// @run-at      document-start
// @license     MIT
// @version     1.0.4
// @author      c0des1ayer
// @connect     cdn.jsdelivr.net
// @antifeature This script loads the latest version of an external script using a CDN, which may potentially become malicious in the future.
// ==/UserScript==
/* jshint esversion: 8 */
(async function() {
    'use strict';

    function fetchAndExecuteScript(url, callback) {
        GM.xmlHttpRequest({
            method: 'GET',
            url: url,
            onload: (response) => {
                if (response.status >= 200 && response.status < 300) {
                    const scriptText = response.responseText;
                    const script = document.createElement('script');
                    script.textContent = scriptText;
                    document.head.appendChild(script);
                    console.debug(`Successfully executed script from: ${url}`);
                    callback && callback();
                } else {
                    console.error(`Failed to load script: ${url}. Status: ${response.status}`);
                }
            },
            onerror: (err) => {
                console.error(`Error fetching script: ${url}`, err);
            }
        });
    }

    fetchAndExecuteScript('https://cdn.jsdelivr.net/gh/Blooket-Council/Blooket-Cheats@latest/cheats/KGui.min.js');
})();