Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iFrame中的SWFobject:跨域的东西?_Iframe_Flash_Embed_Swfobject - Fatal编程技术网

iFrame中的SWFobject:跨域的东西?

iFrame中的SWFobject:跨域的东西?,iframe,flash,embed,swfobject,Iframe,Flash,Embed,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

我有一个带有嵌入式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
我想知道父窗口(其中包含iframe)与iframe中的swfobjet有什么关系?如上所述,swfobject用于将flash嵌入到加载到iframe中的子页面上。
iframe测试/index.html
网站刚刚

<body>
    <iframe src="http://localhost.lan/embed/GYZA" width="100%" height="100%" frameborder="0" allowfullscreen></iframe>
</body>

…在上面。没别的了。为什么我在这里尝试了
不安全的javascript

有什么想法吗?先谢谢你


更新:好吧,我刚刚意识到Youtube和Vimeo的嵌入式播放器也是如此。我正在使用chrome控制台,Youtube和Vimeo也出现了同样的错误。

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

我刚刚验证了Matt的更新问题

每当flash对象嵌入到跨域iframe中时,它都会引发跨域异常。Youtube和Vimeo也是如此

例如,检查这个嵌入了iFrame的JSFIDLE:


<object width="420" height="315"><param name="movie" value="http://www.youtube.com/v/6V_DsL1x1uY?version=3&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/6V_DsL1x1uY?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>