Steam Ignored Games Hider

Hides all ignored games on Steam's front page, it works in real-time.

目前為 2024-03-18 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Steam Ignored Games Hider
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Hides all ignored games on Steam's front page, it works in real-time.
// @author       Unbroken
// @match        https://store.steampowered.com/*
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==

(function() {
    'use strict';

    // Function to hide elements with class .ds_ignored
    function hideElements() {
        document.querySelectorAll('.ds_ignored').forEach(element => {
            element.style.display = 'none';
        });
    }

    // Hide elements on initial page load
    hideElements();

    // Create a MutationObserver to watch for changes in the DOM
    const observer = new MutationObserver(mutationsList => {
        for (let mutation of mutationsList) {
            if (mutation.type === 'childList' || mutation.type === 'attributes') {
                hideElements(); // Re-hide elements if DOM changes
            }
        }
    });

    // Start observing the target node for DOM changes
    const targetNode = document.body;
    const config = { attributes: true, childList: true, subtree: true };
    observer.observe(targetNode, config);
})();