Last active
December 14, 2016 17:58
-
-
Save jtojnar/7f2486e9745ecd40cd3c to your computer and use it in GitHub Desktop.
Club Penguin blue rectangle fix
This file contains hidden or 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 Club Penguin blue rectangle fix | |
// @namespace http://fan-club-penguin.cz/ | |
// @version 0.3 | |
// @description Fixes blue rectangles on Club Penguin and also makes it a little faster on some computers | |
// @author Lisured | |
// @run-at document-start | |
// @match http://play.clubpenguin.com/* | |
// @grant none | |
// ==/UserScript== | |
document.addEventListener('DOMContentLoaded', function(event) { | |
var rgb = window.getComputedStyle(document.body)['background-color'].match(/\d+/g); | |
var hex = '#' + parseInt(rgb[0]).toString(16) + parseInt(rgb[1]).toString(16) + parseInt(rgb[2]).toString(16); | |
var newRenderFunction = CP.FlashClient.prototype.render.toString().replace('"transparent"', '"direct", "bgcolor": "' + hex + '"'); | |
CP.FlashClient.prototype.render = new Function(newRenderFunction.substring(newRenderFunction.indexOf('{')+1,newRenderFunction.lastIndexOf('}'))); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested in Chromium 43