Created
June 29, 2019 08:09
-
-
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.
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 [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