Powerline.io Low Graphics Mode

Automatically set low graphics mode for Powerline.io

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

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

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

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

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