'Delta - 999999 合 1'

Delta - agario 的扩展,带广告拦截器

当前为 2025-04-07 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name                'Delta - 999999 in 1
// @name:ru             'Delta - 999999 в 1
// @name:ru             'Delta - 999999 в 1'
// @name:ja             'デルタ - 999999 イン 1'
// @name:es             'Delta - 999999 en 1'
// @name:zh-CN          'Delta - 999999 合 1'
// @name:de             'Delta - 999999 in 1'
// @name:ar             'دلتا - 999999 في 1'
// @description         Delta - extension for agario, with adblocker
// @description:es      Delta - extensión para agario, con bloqueador de anuncios
// @description:ru      Delta - расширение для агарио с блокировщиком рекламы
// @description:zh-CN   Delta - agario 的扩展,带广告拦截器
// @description:uk      Delta - розширення для agario з блокувальником реклами
// @description:tr      Delta - agario için reklam engelleyici uzantı
// @description:de      Delta – Erweiterung für Agario mit Werbeblocker
// @description:ja      Delta - agario の広告ブロッカー付き拡張機能
// @description:pl      Delta - rozszerzenie do agario z blokadą reklam
// @description:fr      Delta - extension pour agario avec bloqueur de publicité
// @description:ar      دلتا - إضافة لـ Agario مع مانع إعلانات
// @version      7.8
// @namespace    delta.agar
// @author       neo
// @icon         https://deltav4.gitlab.io/favicon.ico
// @match        *://*.agar.io/*
// @run-at       document-start
// @grant        GM.xmlHttpRequest
// @grant        GM.registerMenuCommand
// @grant        window.close
// @grant        unsafeWindow
// @license      Proprietary
// ==/UserScript==

/*
  GREASYFORK VERSION

  Sorry, Delta is no longer available for GreasyFork users.
  Delta will be available again after all GreasyFork rules are met.
  Right now there is a lite version of Delta

  If this user script does not start, write me a discord
  Если данное расширение не запускается, напишите мне в дискорд
  https://discord.gg/HHmyKW6

*/

try {
    GM.registerMenuCommand('\uD83D\uDF02\u2077 External: Delt.io', function () {
        window.location.href = 'https://delt.io/';
    });
    GM.registerMenuCommand('\ud83d\uddf8 Stock Agar.io', function () {
        window.location.href = 'https://agar.io/noext';
    });
    GM.registerMenuCommand('\uD83D\uDDAD External: Delta Discord', function () {
        window.location.href = 'https://bit.ly/3RXQXQd';
    });
} catch (e) {}

if (window.document && window.document.title === 'Attention Required! | Cloudflare') {
    if (!/you have been blocked/.test(window.document.body.innerHTML)) {
        return;
    }
}

const host2path = {
    sigmally: '/terms.html',
    '': '/delta'
};

if (window.location.pathname === '/') {
    window.stop();
    for (const [host, path] of Object.entries(host2path)) {
        if (window.location.host.includes(host)) return (window.location.href = path);
    }
}

for (const [, path] of Object.entries(host2path)) {
    if (window.location.pathname.includes(path)) {
        window.history && window.history.replaceState && window.history.replaceState({}, window.document.title, '/');
        break;
    }
}

var defaultMode = 'default';

var modes = {
    default: function () {
        /**
         * Vue selector
         * example: find_node(window['agarApp'].home, (child, depth) => { if(child.$vnode?.tag?.toLowerCase().includes('home')) return true })
         * @param {*} where window.agarApp.home
         * @param {(child: any, depth: number) => any} cond
         * @returns {any[]}
         */
        const find_node = (where = unsafeWindow['agarApp'].home, cond) => {
            const results = [];

            const find_static = (where = unsafeWindow['agarApp'].home, cond) => {
                function each_children(child, depth) {
                    depth += 1;
                    child.forEach((ch) => {
                        if (cond(ch, depth)) results.push(ch);
                        ch.children && each_children(ch.children, depth);
                    });
                }
                each_children(where, -1);
                return results;
            };

            function each_children(child, depth) {
                depth += 1;
                if (cond(child, depth)) results.push(child);
                child._staticTrees && find_static(child._staticTrees, cond);
                // console.log(depth, 'TAG:', child, child.$vnode?.tag)
                child.$children?.forEach((ch) => {
                    each_children(ch, depth);
                });
                child.children?.forEach((ch) => {
                    each_children(ch, depth);
                });
                child._vnode?.children?.forEach((ch) => {
                    each_children(ch, depth);
                });
                child._vnode?.componentOptions?.children?.forEach((ch) => {
                    each_children(ch, depth);
                });
            }
            each_children(where, -1);
            return results;
        };

        function init() {
            // Ads delete
            find_node(undefined, (child, depth) => {
                if (child.$vnode?.tag.includes('-ads')) return true;
            })[0]?.$destroy();
            find_node(undefined, (child, depth) => {
                if (child.$vnode?.tag.includes('-promo')) return true;
            })[0]?.$destroy();
            find_node(undefined, (child, depth) => {
                return child.elm?.id?.includes('agar-io');
            }).forEach((child) => {
                child.elm.parentElement?.removeChild(child.elm);
            });

            find_node(undefined, (child, depth) => child.playVideoAd).forEach((elem) => {
                elem.getVideoTimestamp = () => Date.now();
            });

            {
                const vnode = find_node(undefined, (child, depth) => Object.getPrototypeOf(child).hasOwnProperty('hasBottomAd'))?.[0];
                if (vnode) {
                    Object.defineProperties(vnode, {
                        fastEntry: { get: () => true }
                    });
                }
            }

            // Youtube, FB buttons
            {
                const vnode = find_node(undefined, (child, depth) => {
                    if (child?.elm?.id == 'socialButtons') return true;
                })[0];
                if (vnode) {
                    vnode.elm.parentElement.removeChild(vnode.elm);
                }
            }

            // Skin floating badge
            {
                const bubble = find_node(undefined, (child, depth) => child.data?.staticClass?.includes('bubble'))[0];
                bubble?.elm?.parentElement.removeChild(bubble?.elm);
            }

            unsafeWindow['agarApp'].ads = {
                requestAds() {},
                requestAd() {},
                refreshAd() {},
                destroyAd() {},
                adSlots() {},
                enableTargetedAds() {},
                disableTargetedAds() {},
                isTargeted() {},
                supersonicAds: {
                    BrandConnectReadyEvent() {},
                    BrandConnectDoneEvent() {},
                    BrandConnectOpenEvent() {},
                    BrandConnectCloseEvent() {},
                    BrandConnectCompletedEvent() {},
                    hasEngagement() {
                        return false;
                    }
                }
            };
        }

        addEventListener('core_init_complete', () => {
            try {
                init();
            } catch (e) {
                console.error(e);
            }
        });
    }
};

var matched = modes[defaultMode];
for (var mode in modes) {
    var isMatched = window.location.pathname.toLowerCase().indexOf(mode) > -1;
    if (isMatched) {
        matched = modes[mode];
        break;
    }
}

if (document && document.documentElement) {
    document.documentElement.innerHTML = `
    <style>
    html,body{font:1.2em "Fira Sans", sans-serif;color:white;height:100%;padding:0;margin:0}
    body{background:
    radial-gradient(circle at bottom right,#36003e, transparent 27%),
    radial-gradient(circle at top left,#36003e, transparent 27%),
    linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100%);}
    .body {
       height:100%;
       display: flex;
       justify-content: center;
       align-items: center;
    }
    </style>
    <div class="body">Extension is loading</div>
    `;
}

loader();

function loader() {
    setTimeout(function () {
        GM.xmlHttpRequest({
            method: 'GET',
            url: window.location.pathname,
            onload: async function (e) {
                var blob = new Blob(['\ufeff' + e.responseText], { type: 'text/html;charset=windows-1252' });
                var reader = new FileReader();
                reader.onload = function () {
                    document.open();
                    document.write(reader.result);
                    document.close();
                    matched();
                };
                reader.readAsText(blob);
            }
        });
    }, 1500);
}