1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25

content / test / data / accessibility / fullscreen / iframe.html [blame]

<!DOCTYPE html>
<div id="target">
 <button>Enter fullscreen</button>
 <a href="/">link inside target</a>
</div>
<script>
const target = document.getElementById('target');

const button = document.querySelector('button');
button.addEventListener('click', function() {
  target.webkitRequestFullscreen();
});

document.onwebkitfullscreenchange = function() {
  const iframe = document.createElement('iframe');
  iframe.srcdoc = '<a href="/">link inside iframe</a>';
  document.body.appendChild(iframe);
  iframe.onload = function() {
    document.webkitExitFullscreen();
    document.onwebkitfullscreenchange = function() {
      button.setAttribute('aria-label', 'Done');
    }
  }
}
</script>