// ==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 $( "