Use proper window object for iframe in enter/leave