<!DOCTYPE html>
<html>
  <head>
    <style type='text/css'>
      html, body, iframe {
        border: none;
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
      }
    </style>

    <script type='application/javascript'>
      document.addEventListener('DOMContentLoaded', function() {
        'use strict';

        var iframe = document.getElementById('frame');

        window.addEventListener('message', function(e) {
          if (!e.origin) { return; }
          iframe.setAttribute('srcdoc', e.data);
        });
      }, false);
    </script>
  </head>

  <body>
    <iframe id='frame' sandbox='allow-scripts'></iframe>
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <style type='text/css'>
      html, body, iframe {
        border: none;
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
      }
    </style>

    <script type='application/javascript'>
      document.addEventListener('DOMContentLoaded', function() {
        'use strict';

        var iframe = document.getElementById('frame');

        window.addEventListener('message', function(e) {
          if (!e.origin) { return; }
          iframe.setAttribute('srcdoc', e.data);
        }, false);
      }, false);
    </script>
  </head>

  <body>
    <iframe id='frame' sandbox='allow-scripts'></iframe>
  </body>
</html>

Add explicit useCapture arg to window.addEventListener
Add explicit useCapture arg to window.addEventListener
