// faça o hack
document.childNodes [1] .style.width = “100%”; // defina o HTML para 100% / 100%
document.childNodes [1] .style.height = “100%”;
document.body.style.width = “100%”; // definir o <body> para 100% / 100%
document.body.style.height = “100%”;
var viewportDimsHack = this.treeBrowserDocument.createElement (“div”);
viewportDimsHack.style.position = “fixo”;
viewportDimsHack.style.left = “0px”;
viewportDimsHack.style.top = “0px”;
viewportDimsHack.style.width = “100%”;
viewportDimsHack.style.height = “100%”;
document.body.appendChild (viewportDimsHack);
// obtém a largura / altura da janela de visualização
var viewportWidth = viewportDimsHack.offsetWidth;
var viewportHeight = viewportDimsHack.offsetHeight;
// desfaça o hack
document.body.removeChild (viewportDimsHack);
document.childNodes [1] .style.width = “”;
document.childNodes [1] .style.height = “”;
document.body.style.width = “”;
document.body.style.height = “”;