Debugging Can't access dead object error. var document = realwindow.document revives the document.