RA-See More

Clicks the "see more" button on the user page

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         RA-See More
// @namespace    https://metalsnake.space/
// @version      0.1
// @description  Clicks the "see more" button on the user page
// @author       MetalSnake
// @match        *://retroachievements.org/user/*
// @grant        none
// @license      MIT
// ==/UserScript==

var l_foundButton = false;

function clickButton() {
    // Suche nach dem Button
    const buttons = document.querySelectorAll('button.absolute');
    buttons.forEach((button) => {
        if (button.innerText == "see more2") {
            button.click();
            l_foundButton = true;
        }
    });

    if (!l_foundButton) {
        let textNode = findTextNode(document.body, "see more");
        if (textNode) {
            textNode.parentNode.click();
        }
    }
}

function findTextNode(root, text) {
    let walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null, false);
    let node;
    while (node = walker.nextNode()) {
        if (node.nodeValue.trim() === text) {
            return node;
        }
    }
    return null;
}

clickButton();