Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save RobDangerous/92d3512b28ef0ecde6fa2275c25cdd10 to your computer and use it in GitHub Desktop.
Save RobDangerous/92d3512b28ef0ecde6fa2275c25cdd10 to your computer and use it in GitHub Desktop.
Xbox 360 Marketplace Purchase Fixer
// ==UserScript==
// @name xbox 360 marketplace purchase fixer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description allow xbox 360 free gold game to be redeemed through web site
// @author mcawesomept, robdangerous
// @match https://live.xbox.com/*
// @license MIT
// @grant none
////allows running user script sooner:
// @run-at document-start
// ==/UserScript==
/*
Notes:
due to a bug in the xbox 360 marketplace, countries that use a comma, ",", as decimal separator will fail to redeem free xbox 360 games with gold
this is a script to allow google chrome to redeem the free game without any manual requirements for the user
*/
console.log("xbox 360 marketplace purchase fixer has been loaded");
var searchPidl = true;
if(searchPidl === true)
{
var checkPrerequisites = window.setInterval(function()
{
var preReqElement = document.getElementById("pidlContainer");
if(preReqElement != null)
{
console.log("the script has been loaded. fixing amount...");
var preReqScript = preReqElement.nextSibling.nextElementSibling;
var preReqScriptHTML = preReqScript.innerHTML.replace(/amount: ([\d]*),([\d]*)/g, "amount: $1.$2");
//remove existing script and add new one
preReqScript.remove();
var liveFixedScript = document.createElement("script");
liveFixedScript.innerHTML = preReqScriptHTML;
document.head.appendChild(liveFixedScript);
console.log("amount fixed");
clearInterval(checkPrerequisites);
//debugger;
}
}, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment