When I make a local html load another local html file in a iFrame (frame.src=) in Chrome, I cannot access its document through contentWindow or contentDocument (even with the verification of contentWindow being the document itself) because it seems Chrome doesn't allow it when a local html file is involved. Is it possible that this feature will change in next releases of Chrome? Note: it works (contentDocument or contentWindow) with Safari and Opera, IE, WebKit. It seems to be a security issue but contentDocument and contentWindow are from W3C.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It is because of Chrome restriction known as Same-Origin Policy. By default the local files are considered to belong to different origins and not allowed to access one from another. To solve the issue, you can launch the Chrome application with the --allow-file-access-from-files
command-line switch.