Prevent crashes on IE's "unspecified error"

Occurs when accessing document.activeElement in an iframe