// ==UserScript== // @name igg on store pages // @namespace my-web-site.cyleja1234.repl.co/ // @version 3.0 // @description open game on igg-games (other game store platforms coming soon!)[steam epic games oprigin] // @author Unknown81311#6616 (discord) // @license GPL-3.0-or-later // @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js // @match *store.steampowered.com/app/* // @match https://www.epicgames.com/store/* // @match https://www.origin.com/* // @icon url https://store.steampowered.com/favicon.ico // @icon https://store.steampowered.com/favicon.ico // @copyright 2020, unknown81311 (https://openuserjs.org/users/unknown81311) // @downloadURL none // ==/UserScript== var hostname = window.location.origin; //find curent domain if ("https://store.steampowered.com" === window.location.origin) { //for steam var name = $(".apphub_AppName").text(), appName = name.replace(/ /g, "-").replace(/[^a-zA-Z0-9 -]/g, ""), el1 = document.querySelector("#game_area_purchase > div.game_area_purchase_game_wrapper > div > div.game_purchase_action > div.game_purchase_action_bg > div.btn_addtocart"); //get game name //set clone target elemnt $(el1).clone().prependTo(".game_purchase_action").css({float: "right",display: "inline-block","background-color": "#000000",padding: "2px 2px 2px 0px"}); //clone originall button and add style var link = "https://igg-games.com/" + appName + "-free-download.html", target = "#game_area_purchase > div.game_area_purchase_game_wrapper > div > div.game_purchase_action > div.btn_addtocart > a"; //setlink //set targettred elemnt $(target).attr("href", link), //change link $(target).attr("target", "_blank"), //redirect to new tab $(target + " > span").text("Free"), //rename to free $("#dlc_purchase_action > div:nth-child(1)").remove(), //remove bug $("#game_area_purchase > div:nth-child(2) > div > div.game_purchase_action > div.btn_addtocart").remove()// remove bug } if ("https://www.epicgames.com" === window.location.origin) { //for epic games $( "
" ).appendTo( "#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div > div.ProductDetails-wrapper_2d124844 > div > div.ProductDetailHeader-wrapper_e0846efc > div:nth-child(2) > div > div > div.Description-ctaWrapper_e8d00c38 > div > div > div > div.css-wgi9q7" );// add free buttons $("#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div > div.ProductDetails-wrapper_2d124844 > div > div.ProductDetailHeader-wrapper_e0846efc > div:nth-child(2) > div > div > div.Description-ctaWrapper_e8d00c38 > div > div > div > div.css-wgi9q7 > div:nth-child(1)").remove();// remove old buttons var el2 = $("#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > nav.css-1v9fujt-PageNav__topNav-PageNav__desktopNav-PageNav__themed > div > nav > div > div.css-eizwrh-NavigationBar__contentPrimary > ul > li:nth-child(2) > a > h2 > span").text().replace(/ /g, "-").replace(/[^a-zA-Z0-9 -]/g, "");// get link var link2 = "https://igg-games.com/" + el2 + "-free-download.html" $("#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div > div.ProductDetails-wrapper_2d124844 > div > div.ProductDetailHeader-wrapper_e0846efc > div:nth-child(2) > div > div > div.Description-ctaWrapper_e8d00c38 > div > div > div > div.css-wgi9q7 > div > button").wrap(""); $("#dieselReactWrapper > div > div.css-igz6h5-AppPage__bodyContainer > main > div > div > div.ProductDetails-wrapper_2d124844 > div > div.ProductDetailHeader-wrapper_e0846efc > div:nth-child(2) > div > div > div.Description-ctaWrapper_e8d00c38 > div > div > div > div.css-wgi9q7 > div > a:nth-child(2)").attr("href", link2);// set new link } if ("https://www.origin.com" === window.location.origin) { // for origin, in proggress... var name3 = document.querySelector("#storecontent > section:nth-child(21) > div > origin-store-osp-termsandconditions > div > otkex-legal > div > strong").text();// get game name alert(name3); }