Html window.frames返回空窗口

Html window.frames返回空窗口,html,frameset,Html,Frameset,我正试着在我的本地机器上做这件事。它只是一个普通的html文件,字面意思如下:- <html> <head> <title>Testing</title> </head> <frameset framespacing="0" frameborder="0" rows="20px,100%" border="0"> <frame src="index.html" name="mine_top"

我正试着在我的本地机器上做这件事。它只是一个普通的
html
文件,字面意思如下:-

<html>
  <head>
    <title>Testing</title>
  </head>
  <frameset framespacing="0" frameborder="0" rows="20px,100%" border="0">
   <frame src="index.html" name="mine_top" frameborder="0" scrolling="no", noresize="1">
   <frame src="index.html" name="mine_inner">
</frameset>
</html>
两者都不返回我期望的
窗口
对象。当我尝试使用
window.frames[0].document访问
文档时,它会抛出此错误

DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.

我被踩死了。我可以访问
frames
很好,它的设置与
reddit
在同一个浏览器中的设置相同,但我一辈子都不能让我的工作

我找到了答案。该页面必须由服务器提供。看起来您无法仅通过打开该文件来访问
window.frames

我使用
node static
包提供页面

DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.