> console.log(length) Output: 1
window.length returns the number of frames
Read more about Window.length on MDN
Returns the number of frames (either
<iframe>elements) in the window.
On a (blank) page without such elements it’s expected to return
0, here on this exact StackOverflow page you might expect something like
To get more info you might want to use
Also from the MDN Docs Window.frames:
Returns the window itself, which is an array-like object, listing the direct sub-frames of the current window.