当我尝试访问 iframe 元素的 contentWindow.document 时,出现错误,0x80070005 - Access is denied.
.
是否无法访问 iframe 文档的元素?
文件:
- iframe.html
- iframe_test.ahk
iframe.html
<html>
<head></head>
<body>
<iframe width="100%" height="100%" name="myframe" src="http://www.w3schools.com"></iframe>
</body>
</html>
iframe_test.ahk
Gui, New, Resize MaximizeBox
Gui, Add, ActiveX, vWB w780 h580, % A_ScriptDir "\iframe.html"
Gui, show, w800 h600
Loop
Sleep 10
Until (WB.readyState=4 && WB.document.readyState="complete" && !WB.busy)
msgbox % WB.document.All["myframe"].contentwindow.document.documentElement.innerHTML