jari96 / Chaturbate

// ==UserScript==
// @name         Chaturbate
// @version      1.0
// @match        *chaturbate.com*
// ==/UserScript==
function resize() {
    var w = window,
        d = document,
        e = d.documentElement,
        g = d.getElementsByTagName('body')[0],
        x = w.innerWidth || e.clientWidth || g.clientWidth,
        y = w.innerHeight|| e.clientHeight|| g.clientHeight;
    if((x/y)>ver) {
        object.width=y*ver;
        object.height=y;
    } else if (y/x<ver) {
        object.width=x;
        object.height=x/ver;
    }
}
var start = document.body.innerHTML;
var player = document.getElementById('player');
if (player !== null) {
    var ver = player.offsetWidth/player.offsetHeight;
    document.body.innerHTML = player.innerHTML;
    document.documentElement.style.overflow = 'hidden';
    var object = document.getElementsByTagName('object')[0];
    window.onresize = resize;
    resize();
}