Kogama Optimization - Lag Reduction

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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
})();