Skip to content

Instantly share code, notes, and snippets.

@jtojnar
Last active December 14, 2016 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtojnar/7f2486e9745ecd40cd3c to your computer and use it in GitHub Desktop.
Save jtojnar/7f2486e9745ecd40cd3c to your computer and use it in GitHub Desktop.
Club Penguin blue rectangle fix
// ==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('}')));
});
@jtojnar
Copy link
Author

jtojnar commented Jul 18, 2015

Tested in Chromium 43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment