Skip to content

Instantly share code, notes, and snippets.

@Js41637
Created June 29, 2019 08:09
Show Gist options
  • Save Js41637/9c8fe3bf3999c2adac4a9b8556ab3068 to your computer and use it in GitHub Desktop.
Save Js41637/9c8fe3bf3999c2adac4a9b8556ab3068 to your computer and use it in GitHub Desktop.
Fixes the grand pix site from erroring. Requires either TamperMonkey or GreaseMonkey for Chrome or Firefox respectively.
// ==UserScript==
// @name [Steam] Fix Grandpix
// @version 1.0
// @description Fix Valve being bad.
// @author You
// @match https://store.steampowered.com/grandprix
// @grant none
// @run-at document-body
// ==/UserScript==
// Original function called to start the thing
var ogUpdateTeamScoresWithData = window.UpdateTeamScoresWithData
// Override their function with ours that fixes their bad data
window.UpdateTeamScoresWithData = function(data) {
data.scores = data.scores.map(score => {
score.score_dist = +score.score_dist; // converts string to int
return score;
})
// Call the original function with the fixed data
ogUpdateTeamScoresWithData(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment