Workaround for iOS Safari iframe behavior by adding listeners to the document.