您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto-enable dark theme on UnknownCheats
// ==UserScript== // @name UnknownCheats Auto Dark Theme // @namespace http://tampermonkey.net/ // @version 1.0 // @description Auto-enable dark theme on UnknownCheats // @author LeonardoVAC // @match https://www.unknowncheats.me/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Simple function to check if dark mode is active function isDarkMode() { // Check for uc_dark.css in stylesheets const stylesheets = document.querySelectorAll('link[rel="stylesheet"]'); for (let stylesheet of stylesheets) { if (stylesheet.href && stylesheet.href.includes('uc_dark.css')) { return true; } } return false; } // Simple toggle function function toggleTheme() { if (typeof window.toggle_dark_theme === 'function') { window.toggle_dark_theme(); return true; } return false; } // Make function globally accessible window.ucIsDarkMode = isDarkMode; // Toggle to dark mode if currently in light mode function toggleToDark() { if (typeof window.toggle_dark_theme === 'function' && !isDarkMode()) { console.log('Auto-toggling to dark mode...'); window.toggle_dark_theme(); } } // Initialize when ready function init() { if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); return; } console.log('UnknownCheats Auto Dark Theme loaded'); console.log('Current theme:', isDarkMode() ? 'Dark' : 'Light'); // Auto-toggle to dark mode after a short delay toggleToDark(); } init(); })();