您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically clicks "Show more" buttons on the Steam Store site when visible.
- // ==UserScript==
- // @name Auto Click "Show more" on Steam Store
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description Automatically clicks "Show more" buttons on the Steam Store site when visible.
- // @author YourName
- // @match https://store.steampowered.com/*
- // @grant none
- // ==/UserScript==
- (function () {
- 'use strict';
- // Function to check if an element is in the viewport
- function isElementInViewport(el) {
- const rect = el.getBoundingClientRect();
- return (
- rect.top >= 0 &&
- rect.left >= 0 &&
- rect.bottom <= (window.innerHeight + 1500 || document.documentElement.clientHeight + 1500) &&
- rect.right <= (window.innerWidth || document.documentElement.clientWidth)
- );
- }
- // Function to check and click the "Show more" button
- function clickShowMore() {
- const buttons = document.querySelectorAll('button'); // Find all buttons on the page
- buttons.forEach(button => {
- if (button.innerText.trim() === "Show more" && isElementInViewport(button)) {
- console.log("Clicking 'Show more' button...");
- button.click();
- }
- });
- }
- // Run the script periodically
- setInterval(clickShowMore, 100); // Check every 1 second
- })();