steam, navigate inventory pages

adds event listeners to the arrows keys to navigate inventory pages

  1. // ==UserScript==
  2. // @name steam, navigate inventory pages
  3. // @description adds event listeners to the arrows keys to navigate inventory pages
  4. // @version 1.1
  5. // @author Tobias L
  6. // @include https://steamcommunity.com/id/*/inventory*
  7. // @license GPL-3.0-only
  8. // @namespace https://github.com/WhiteG00se/User-Scripts
  9. // ==/UserScript==
  10.  
  11. setTimeout(function () {
  12. const nextPageButton = document.querySelector(".sih_button.next_page")
  13. const previousPageButton = document.querySelector(".sih_button.prev_page")
  14. document.addEventListener("keydown", function (e) {
  15. if (e.key === "ArrowRight") nextPageButton.click()
  16. if (e.key === "ArrowLeft") previousPageButton.click()
  17. })
  18. }, 1000)