Skip to content

Instantly share code, notes, and snippets.

@SomeBall-1
Last active December 6, 2016 04:05
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 SomeBall-1/eb79f5c4140ae7f8d7b4eb7050063192 to your computer and use it in GitHub Desktop.
Save SomeBall-1/eb79f5c4140ae7f8d7b4eb7050063192 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Kongregate Larger Game Size
// @namespace http://tampermonkey.net/
// @version 0.4
// @author Some Ball -1
// @include http://www.kongregate.com/games/koalabeast/tagpro*
// @grant none
// ==/UserScript==
function wait() {
if(!window.GameIframe || !window.GameIframe.prototype.setSizeToMaxForWindow) return setTimeout(wait);
let chatbox = document.getElementById('chat_container_cell');
chatbox.parentNode.removeChild(chatbox);
let heightPadding = 0;
var sstmfw = window.GameIframe.prototype.setSizeToMaxForWindow;
window.GameIframe.prototype.setSizeToMaxForWindow = function() {
let stuff = [$("flashframecontent"), $("maingamecontent"), $("gameholder"), $("game"), $("gameiframe"), document.getElementsByClassName('game_table')[0]];
for(var i = 0;i < stuff.length;i++) {
stuff[i].style.width = $(stuff[i]).style.height = '100%';
}
let maingame = $("maingame");
maingame.style.margin = 0;
maingame.style.width = (window.document.body.clientWidth-20)+'px'; //clientWidth instead of window.innerWidth to account for scrollbar, -20 for the 10px padding on either side
maingame.style.height = (window.innerHeight-heightPadding)+'px';
};
}
wait();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment