RA-See More

Clicks the "see more" button on the user and game page

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         RA-See More
// @namespace    https://metalsnake.space/
// @version      0.6.5
// @description  Clicks the "see more" button on the user and game page
// @author       MetalSnake
// @match        *://retroachievements.org/*
// @icon         https://static.retroachievements.org/assets/images/favicon.webp
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    const TARGETS = ["see more"];
    let lastUrl = location.href;

    function clickButton() {
        const buttons = document.querySelectorAll("button");

        for (const button of buttons) {
            const text = button.innerText.trim().toLowerCase();

            if (TARGETS.includes(text)) {
                button.click();
                return true;
            }
        }
        return false;
    }

    function onUrlChange() {
        // kleiner Delay, damit der neue DOM aufgebaut werden kann
        setTimeout(clickButton, 50);
    }

    //// Initialer Seitenaufruf
    //clickButton();
     setTimeout(() => {
        clickButton();
    }, 100);

    // pushState / replaceState hooken
    const originalPushState = history.pushState;
    const originalReplaceState = history.replaceState;

    history.pushState = function (...args) {
        originalPushState.apply(this, args);
        if (location.href !== lastUrl) {
            lastUrl = location.href;
            onUrlChange();
        }
    };

    history.replaceState = function (...args) {
        originalReplaceState.apply(this, args);
        if (location.href !== lastUrl) {
            lastUrl = location.href;
            onUrlChange();
        }
    };

    // Browser zurück / vor
    window.addEventListener('popstate', () => {
        if (location.href !== lastUrl) {
            lastUrl = location.href;
            onUrlChange();
        }
    });

})();