Fix App Image Not Found

Fix App Image Not Found on steam pages

  1. // ==UserScript==
  2. // @name Fix App Image Not Found
  3. // @namespace https://greasyfork.org/users/2205
  4. // @version 0.1
  5. // @description Fix App Image Not Found on steam pages
  6. // @author Rudokhvist
  7. // @match https://steamcommunity.com/id/*
  8. // @match https://steamcommunity.com/profiles/*
  9. // @license Apache-2.0
  10. // @run-at document-idle
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. var images=document.querySelectorAll("img[src$='338200c5d6c4d9bdcf6632642a2aeb591fb8a5c2.gif']");
  17. if (!images.length) { return; }
  18. for (var index = 0;index<images.length;index++) {
  19. var appidRegex = images[index].parentElement.href.match(/(?:store\.steampowered|steamcommunity)\.com\/(app|market\/listings)\/(\d+)\/?/);
  20. if (appidRegex != null) {
  21. var appid = appidRegex[2];
  22. if (appid != 223530) { //TODO: check if there is other exceptions. if there are - make more complex condition here
  23. images[index].src="https://steamcdn-a.akamaihd.net/steam/apps/" + appid + "/capsule_184x69.jpg";
  24. }
  25. }
  26. }
  27. })();