Last active
April 30, 2020 05:18
-
-
Save solarmicrobe/180b97aa478a0afe3da74c11bfb546ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Fanatical Redeem Steam Link | |
// @namespace http://rezzell.com | |
// @version 0.1 | |
// @description Show Redeem link on Fanatical simlar to Humble Bundle | |
// @author Russell Parks | |
// @match https://www.fanatical.com/en/orders/* | |
// @grant none | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js | |
// ==/UserScript== | |
function addRedeemLink(elem, key){ | |
newElem = $('<div class="input-group-btn"><button type="button" class="btn btn-primary" onclick=>Redeem</button></div>'); | |
newElem.appendTo(elem); | |
newElem.click(function(){ | |
window.open('https://store.steampowered.com/account/registerkey?key='+key,'_blank'); | |
}); | |
} | |
function addLinks(){ | |
$('dd > div > div > div.input-group > input.form-control[value]').parent().not($('button:contains("Redeem")').parent().parent()).find('input.form-control[value]').each(function(){ | |
addRedeemLink(this.parentNode, this.value); | |
}); | |
} | |
$(document).ready(function() { | |
addLinks(); | |
setInterval(addLinks, 2000); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment