2

如何在本地主机上加载执行的 swf 时禁用 crossdomain.xml 检查?

Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://localhost:2541/xxx.swf cannot load data from http://www.com/xxx.swf.

我想将完全信任分配给本地运行的 HTML5 Web 应用程序。我想禁用任何跨域检查。

为什么?一些外部服务器不为其托管的 SWF 文件提供 crossdomain.xml。我在本地运行。我希望完全信任调试目的。

我怎么做?

我不会考虑 AIR,因为它不能在 HTML5 应用程序中使用。

将 URL“ http://localhost:2541/xxx.swf ”添加到“C:\Users\Arvo\AppData\Roaming\Macromedia\Flash Player#Security\FlashPlayerTrust\u.cfg”没有帮助。

参考:

  1. http://www.abdulqabiz.com/blog/archives/2007/03/20/flash-player-trust-flashplayertrust-on-gnulinux/

  2. 从 file:/// 运行 SWF,无需用户更改其 Flash Player 安全设置

4

3 回答 3

2

如果您在 Flash 中预览swf,则没有跨域限制。但是,如果您实际上是在浏览器中查看它(例如,本地网络服务器),它就像其他任何东西一样受到限制。您必须将 crossdomain.xml 文件放在另一个站点上,或者让策略服务器使用主策略侦听端口 843。

于 2010-11-02T16:47:54.550 回答
2

使用本地服务器代理远程地址。假设您要连接到:

http://someserver.com/whatever

然后拨打电话:

http://localhost/proxy/someserver.com/whatever

并让本地服务器应用程序进行实际的远程调用并代理响应。

于 2010-11-02T16:55:07.220 回答
0

我相信您需要将文件的本地路径添加到.cfg文件中,而不是您用来访问它的路径。所以你会把/location/of/xxx.swf你的.cfg而不是http://localhost:2541/xxx.swf

于 2010-11-02T16:45:40.853 回答