Instead of all this, how about the following in `iframe.js`:

```
// Push errors to parent iframe.
window.onerror = function() {
  return parent.onerror.apply(parent, arguments);
};
```

I am not worried about cleaning up this handler afterward, so the simpler solution seems more virtuous.