GOG-Games.net Extra Info

Adds more information about the current game you are checking out

  1. // ==UserScript==
  2. // @name GOG-Games.net Extra Info
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Adds more information about the current game you are checking out
  6. // @author TetteDev
  7. // @match https://gog-games.net/game/*/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=gog-games.net
  9. // @connect gog.com
  10. // @grant none
  11. // @run-at document-end
  12. // @license MIT
  13. // @noframes
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. const iframe_id = "ikljasdfjkljasd";
  20. if (document.getElementById(`${iframe_id}`)) return;
  21.  
  22. const borderRadius = 10;
  23. const name = location.pathname.replace("/game/", "").replace("/", "");
  24. const url = `https://www.gog.com/index.php/en/game/${name}`;
  25. if (document.getElementById(`#${iframe_id}`)) return;
  26. const iframe = document.createElement("iframe");
  27.  
  28. iframe.src = url;
  29. iframe.style.cssText = `
  30. width:100%;
  31. height:750px;
  32. display:none;
  33. z-index:999;
  34. -webkit-border-radius: ${borderRadius}px;
  35. -moz-border-radius: ${borderRadius}px;
  36. border-radius: ${borderRadius}px;
  37. border:2px solid black;`;
  38. iframe.onload = () => { iframe.style.display = "block"; };
  39.  
  40. const container = document.querySelector("#game-details");
  41. container.appendChild(iframe);
  42. //document.body.appendChild(iframe);
  43. })();