chromium/third_party/blink/web_tests/http/tests/serviceworker/resources/fetch-script-onerror-iframe.html

<script src="/resources/get-host-info.js"></script>
<script>
var host_info = get_host_info();

window.addEventListener('error', function(evt) {
    window.parent.postMessage(
        {
          filename: evt.filename,
          colno: evt.colno,
          lineno: evt.lineno,
          message: evt.message
        },
        host_info['HTTP_ORIGIN']);
  });

window.addEventListener('message', function(evt) {
    var script = document.createElement('script');
    script.src = evt.data.url;
    document.body.appendChild(script);
  });
</script>