Kongregate UI Cleaner

Removes the adblock warning and suggested games

スクリプトをインストールするには、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         Kongregate UI Cleaner
// @namespace    http://tampermonkey.net/
// @match        *://www.kongregate.com/games/*
// @match        *://www.kongregate.com/en/games/*
// @run-at       document-start
// @grant        none
// @version      1.4
// @description  Removes the adblock warning and suggested games
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function removeElements() {
        document.querySelectorAll('img[src*="warning_amber"]').forEach(img => {
            const container = img.closest('div[style*="position: fixed"], div[style*="position:fixed"]');
            container?.remove();
        });

        const elementsToRemove = [
            document.querySelector('.hidden.lg\\:block.w-\\[350px\\].flex-shrink-0.self-start'),
            document.querySelector('.mt-8.mb-8'),
            document.querySelector('.lg\\:hidden.mt-4'),
        ];

        elementsToRemove.forEach(el => el?.remove());
    }

    new MutationObserver(removeElements).observe(document.documentElement, {
        childList: true,
        subtree: true
    });
})();