Greasy Fork

Greasy Fork is available in English.

Powerline.io Low Graphics Mode

Automatically set low graphics mode for Powerline.io

当前为 2024-11-29 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Powerline.io Low Graphics Mode
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  Automatically set low graphics mode for Powerline.io
// @match        https://powerline.io/*
// @grant        none
// @license      MIT
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Function to set low graphics mode
    function setLowGraphicsMode() {
        // Check if we've already attempted to set low graphics mode
        if (localStorage.getItem('lq_script_run') !== 'true') {
            try {
                // Set low graphics mode
                localStorage.setItem('lq', 'true');

                // Mark that the script has run
                localStorage.setItem('lq_script_run', 'true');

                // Optional: Log confirmation
                console.log('Low Graphics Mode enabled for Powerline.io');

                // Reload the page to apply changes
                window.location.reload();
            } catch (error) {
                console.error('Error setting low graphics mode:', error);
            }
        } else {
            // Remove the flag to allow future runs if needed
            localStorage.removeItem('lq_script_run');
            console.log('Low Graphics Mode script has already run');
        }
    }

    // Run the function when the script loads
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', setLowGraphicsMode);
    } else {
        setLowGraphicsMode();
    }
})();