读书人

chrome中页面有跨域iframe出现Adobe F

发布时间: 2012-10-31 14:37:31 作者: rapoo

chrome中页面有跨域iframe出现Adobe Flash Player安全性设置窗口

http://bbs.9ria.com/viewthread.php?tid=85933&extra=page%3D1%26amp%3Borderby%3Ddateline%26amp%3Bfilter%3D2592000

?

?

本帖最后由 bcpxqz 于 2011-6-16 17:38 编辑

a.html和b.html不同域,a.html用iframe嵌入b.html,在chrome中有时候会出现Adobe?Flash Player安全性设置窗口(图1),在console面板中可以看到,四条"Unsafe?JavaScript attempt to access frame with URL"错误,但如果你看图2,就会发现,
  1. "Unsafe JavaScript attempt to?
  2. access frame with URL http://a.com/adtest/39iframe/d1.html from frame?
  3. with URL http://a.com/adtest/39iframe/d1.html. Domains, protocols and?
  4. ports must?
  5. match."
复制代码是同一页面。我想知道问题出在哪里?在其他ie,firefox,safari,opera里面测试不会出现这个设置窗口,在google?code上也有讨论:http://t.cn/aK3flfhttp://t.cn/aK3flV?。
chrome中页面有跨域iframe出现Adobe Flash Player安全性设立窗口
chrome中页面有跨域iframe出现Adobe Flash Player安全性设立窗口
chrome:10.0.648.45
flash?player:10,2,154,12

代码如下:
a.htm页面结构
  1. <embed id="test1" name="test1" width="100" height="100"?
  2. type="application/x-shockwave-flash"?
  3. pluginspage="http://www.macromedia.com/go/getflashplayer"?
  4. allowscriptaccess="always" allowfullscreen="true" quality="high"?
  5. menu="false" wmode="transparent" src="blank.swf?num=outer">
  6. <iframe
  7. width="100" scrolling="no" height="100" frameborder="0"?
  8. allowtransparency="true" marginheight="0" marginwidth="0"?
  9. src="http://b.com/b.html" name="iframe1"?
  10. id="iframe1"></iframe>
复制代码其中blank.swf中
import flash.external.ExternalInterface;
ExternalInterface.call("console.info",str);

Iframe b.html页面结构
  1. <embed id="AC86_5500" name="AC86_5500" width="100"?
  2. height="100" type="application/x-shockwave-flash"?
  3. pluginspage="http://www.macromedia.com/go/getflashplayer"??allowfullscreen="true"
  4. quality="high" menu="false" wmode="transparent"?
  5. src="blank1.swf">
复制代码其中blank1.swf,没有引入flash.external.ExternalInterface,是个空flash

?

?

?

?

?

?

本帖最后由 ticore 于 2011-6-17 18:59 编辑

http://blog.richmediaplus.com/20 ... omain-inject-issue/


反覆之後,化如下:

1. a.com 下的 HTML ,包含一 b.com 的 iframe
2. b.com iframe 使用 javascript touch 一下 window.top.location
3. a.com 在 onload 完成後,建立一 Flash 物件
4. Flash 物件透 ExternalInterface 呼叫任何 Javascript Function
5. 得到以下息

SecurityError: Error #2060: 行程序安全性:ExternalInterface 呼叫者http://a.com/flash.swf?法存取 [object]。
at flash.external::ExternalInterface$/_initJS()
at flash.external::ExternalInterface$/call()
at flash_fla::MainTimeline/doCallJs()

已化成,很明是出在 javascript window.top.location 物件上
想要避免,只要在主上一入立即先 touch window.top.location 就好了

在程中,另一更重的
跨域的 iframe 能透原型 prototype 插入任意 function 到 location 物件上
top window 面呼叫任何物件
不受跨域安全性的限制

读书人网 >Flash

热点推荐