Ich hab das hier gefunden:
<!DOCTYPE html>
<html lang="de">
<head>
<title>Viewport</title>
<meta charset="utf-8">
<script>
function printViewport() {
vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
document.title="Viewport Breite: " + vw + "px Höhe: " + vh + "px";
}
window.onload = printViewport;
window.onresize = printViewport;
window.onreload = printViewport;
</script>
</head>
<body>
<h1>Test:</h1>
<p>Angaben zum Viewport in der Titelleiste</p>
</body>
</html>