Kogama Optimization - Lag Reduction

Script to minimize lags in Kogama by removing unnecessary elements and animations

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript== K O K U S H I B O
// @name         Kogama Optimization - Lag Reduction
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Script to minimize lags in Kogama by removing unnecessary elements and animations
// @author       K O K U S H I B O
// @match        https://www.kogama.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to optimize Kogama performance
    function optimizeKogama() {
        // Remove ads and unnecessary elements
        document.querySelectorAll('.advertisement, [id^="ad"], iframe[src*="ads"]').forEach(el => el.remove());

        // Disable animations and transitions
        document.querySelectorAll("*").forEach(el => {
            el.style.animation = "none"; // Disable CSS animations
            el.style.transition = "none"; // Disable CSS transitions
        });

        // Reduce graphical load (e.g., remove background images)
        document.body.style.backgroundImage = "none"; // Disable background images
        document.body.style.backgroundColor = "#000000"; // Set black background (optional)

        console.log("Kogama optimization applied successfully.");
    }

    // Apply optimization regularly (for dynamically loaded elements)
    setInterval(optimizeKogama, 2000); // Run every 2 seconds
})();