iFrame中的SWFobject:跨域的东西?

mat*_*att 6 embed flash iframe swfobject

我有一个带有嵌入式Flash文件的简单html站点,并且在其上使用了SWFobject.

这个网站是iframe的src.如果我打开带有iframe的网站,控制台告诉我...... 

Unsafe JavaScript attempt to access frame with URL file:///experiment/iframe-
test/index.html from frame with URL http://localhost.lan/embed/GYZA. Domains,
protocols and ports must match. -> swfobject.js
Run Code Online (Sandbox Code Playgroud)

我想知道父窗口(其中包含iframe)与iframe中的swfobjet有什么关系?因此,如上所述,swfobject用于将flash嵌入到加载到iframe中的子页面上.该iframe-test/index.html网站刚刚......

<body>
    <iframe src="http://localhost.lan/embed/GYZA" width="100%" height="100%" frameborder="0" allowfullscreen></iframe>
</body>
Run Code Online (Sandbox Code Playgroud)

… 在上面.而已.为什么我有unsafe javascript attempt here

有什么想法吗?先感谢您.

更新:嗯,我刚认识到Youtube和Vimeo以及它们的嵌入式播放器都会发生这种情况.我正在使用Chrome控制台,Youtube和Vimeo也会出现同样的错误.

小智 0

不知道现在这是否有任何用处,但会抛出错误,因为浏览器将file:///experiment/iframe-test/index.htmlhttp://localhost.lan/embed/GYZA视为两个不同的域,因此浏览器的跨域策略认为这是不安全的。根据用户使用的浏览器,这可能不安全 - 您正在加载的远程页面可能包含有害脚本,这些脚本可能会破坏您正在查看的当前页面的稳定性或尝试窃取各种信息。您可以在这里找到更多信息。