<html>
<head>
<script>
function enterFullscreen() {
var div = document.getElementById("mydiv");
div.webkitRequestFullScreen();
div.addEventListener("webkitfullscreenchange", function(){
div.style.height = "100%";
div.style.width = "100%";
div.style.backgroundColor = "red";
jsObserver.notifyJava();
});
}
</script>
<style>
body {
margin: 0px;
padding: 0px;
}
#enterFullscreenControl {
height: 100%;
width: 100%;
padding: 0px 0px;
background-color: blue;
}
</style>
</head>
<body>
<button id="enterFullscreenControl" autofocus onclick="enterFullscreen(); return false">
<div id="mydiv"></div>
</button>
</body>
</html>