iframe加载时空白页
<p>[TOC]</p>
<h1>1. 重点:</h1>
<pre><code>So, here’s the solution to the biggest pain — waiting for iframes to load.</code></pre>
<p>The issues:</p>
<pre><code>And that is, it first loads an about:blank page, fires all the load events and sets the readyState to complete .</code></pre>
<h1>2. 解决方案</h1>
<pre><code>if (contentWindow.document.readyState === 'complete') {
return href !== 'about:blank' || src === 'about:blank' || src === '';
}</code></pre>
<h1>3. 参考</h1>
<p>[1]. [Testing iframes with Cypress — including Stripe and HelloSign]( <a href="https://medium.com/appear-here-product-engineering/testing-iframes-with-cypress-including-stripe-and-hellosign-fed90d639870">https://medium.com/appear-here-product-engineering/testing-iframes-with-cypress-including-stripe-and-hellosign-fed90d639870</a>)</p>