webbymans free admin script - websim

provided by ducksim - no gatekeeping

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         webbymans free admin script - websim
// @description  provided by ducksim - no gatekeeping
// @namespace    http://tampermonkey.net/
// @version      6.1
// @match        *://*.websim.ai/*
// @match        *://websim.ai/*
// @match        *://*.websim.com/*
// @match        *://websim.com/*
// @run-at       document-start
// @grant        none
// @allFrames    true
// ==/UserScript==

(function() {
    'use strict';

    // bug fix to prevent the script running twice if its in the same frame
    if (window.hasRunFlyHack) return;
    window.hasRunFlyHack = true;

    const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            mutation.addedNodes.forEach((node) => {
                // finding original script
                if (node.tagName === 'SCRIPT' && node.src && node.src.includes('main.js')) {

                    console.log('[DuckSim] intercepted main.js:', node.src);

                    // block original script
                    node.type = 'javascript/blocked';
                    const originalUrl = node.src;
                    node.remove();

                    // hi if youre reading this
                    fetch(originalUrl)
                        .then(response => response.text())
                        .then(code => {
                            // fixing imports
                            const baseUrl = originalUrl.substring(0, originalUrl.lastIndexOf('/') + 1);
                            code = code.replace(/from\s+['"]\.\/(.*?)['"]/g, `from "${baseUrl}$1"`);

                            // enable the fly/admin
                            code = code.replace(
                                /function isUsernameAdminOrCo\(name\)\s*\{[\s\S]*?\}/,
                                'function isUsernameAdminOrCo(name) { return true; }'
                            );

                            // injection
                            const blob = new Blob([code], { type: 'text/javascript' });
                            const newScript = document.createElement('script');
                            newScript.type = 'module';
                            newScript.src = URL.createObjectURL(blob);
                            document.documentElement.appendChild(newScript);

                            console.log('[DuckSim] injected cheat');
                        });
                }
            });
        });
    });

    // the end.. absolute cinema
    observer.observe(document.documentElement, { childList: true, subtree: true });
})();

// merry christmas