Auto Click "Show more" on Steam Store

Automatically clicks "Show more" buttons on the Steam Store site when visible.

  1. // ==UserScript==
  2. // @name Auto Click "Show more" on Steam Store
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Automatically clicks "Show more" buttons on the Steam Store site when visible.
  6. // @author YourName
  7. // @match https://store.steampowered.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13.  
  14. // Function to check if an element is in the viewport
  15. function isElementInViewport(el) {
  16. const rect = el.getBoundingClientRect();
  17. return (
  18. rect.top >= 0 &&
  19. rect.left >= 0 &&
  20. rect.bottom <= (window.innerHeight + 1500 || document.documentElement.clientHeight + 1500) &&
  21. rect.right <= (window.innerWidth || document.documentElement.clientWidth)
  22. );
  23. }
  24.  
  25. // Function to check and click the "Show more" button
  26. function clickShowMore() {
  27. const buttons = document.querySelectorAll('button'); // Find all buttons on the page
  28. buttons.forEach(button => {
  29. if (button.innerText.trim() === "Show more" && isElementInViewport(button)) {
  30. console.log("Clicking 'Show more' button...");
  31. button.click();
  32. }
  33. });
  34. }
  35.  
  36. // Run the script periodically
  37. setInterval(clickShowMore, 100); // Check every 1 second
  38. })();