Prevent crashing on IE when running in iframes

IE throws "Unspecified error" on `document.activeElement` even after document load when running in an `<iframe>`.