| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Feature-Policy Fullscreen</title> | 2 <title>Feature-Policy Fullscreen</title> |
| 3 <div>Fullscreen</div> | 3 <div>Fullscreen</div> |
| 4 <script> | 4 <script> |
| 5 document.onwebkitfullscreenerror = function() { | 5 document.onwebkitfullscreenerror = function() { |
| 6 parent.postMessage({ type: 'error', enabled: document.webkitFullscreenEnabled
}, '*'); | 6 parent.postMessage({ type: 'error', enabled: document.webkitFullscreenEnabled
}, '*'); |
| 7 }; | 7 }; |
| 8 | 8 |
| 9 document.onwebkitfullscreenchange = function() { | 9 document.onwebkitfullscreenchange = function() { |
| 10 document.webkitExitFullscreen(); | 10 if (document.webkitFullscreenElement) { |
| 11 parent.postMessage({ type: 'change', enabled: document.webkitFullscreenEnabled
}, '*'); | 11 document.webkitExitFullscreen(); |
| 12 parent.postMessage({ type: 'change', enabled: document.webkitFullscreenEnabl
ed }, '*'); |
| 13 } |
| 12 }; | 14 }; |
| 13 | 15 |
| 14 document.addEventListener('keypress', function() { | 16 document.addEventListener('keypress', function() { |
| 15 document.querySelector('div').webkitRequestFullscreen(); | 17 document.querySelector('div').webkitRequestFullscreen(); |
| 16 }); | 18 }); |
| 17 | 19 |
| 18 window.onload = function() { | 20 window.onload = function() { |
| 19 focus(); | 21 focus(); |
| 20 eventSender.keyDown('a', []); | 22 eventSender.keyDown('a', []); |
| 21 } | 23 } |
| 22 </script> | 24 </script> |
| OLD | NEW |