Last active
December 6, 2016 04:05
-
-
Save SomeBall-1/eb79f5c4140ae7f8d7b4eb7050063192 to your computer and use it in GitHub Desktop.
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 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