title: Uncaught DOMException: Blocked a frame with origin "http://localhost:8080" from accessing a cross-origin frame while listing the iframes in page
body: <p>I am trying to list the names of all the <code>iframe</code>s in a page, so I can access them through Selenium.</p>
  
  <p>The problem is that the name of the <code>iframe</code> changes each time, so I need to loop through all of them.</p>
  
  <p>I am getting:</p>
  
  <blockquote>
    <p>Uncaught DOMException: Blocked a frame with origin "<a href="http://localhost:8080" rel="noreferrer">http://localhost:8080</a>" from accessing a cross-origin frame.</p>
  </blockquote>
  
  <p>error when I try to loop over them using:</p>
  
  <pre><code>for (var f = 0; f &lt; window.frames.length; f++) {
      console.log(window.frames[f].name)
  }
  </code></pre>
  
  <p>Is there a way to get the name of the <code>iframe</code> in a different way?</p>