better contentWindow check