Actionscript 安全沙箱违规
我正在将 Photoshop 插件编写为 ExtendScript (Javascript) 文件,然后加载一个 Flash 窗口,我将其称为plugin.swf - 我的plugin.swf 文件使用一个元素来 POST 到某个 URL。 当我使用 Internet Explorer 加载plugin.swf 时,HTTP POST 已成功完成。 当我通过 Javascript 加载plugin.swf(通过 Adobe Photoshop 的“文件”->“脚本”菜单调用)时,HTTP POST 返回以下内容:
... 目标 = (flash.net::URLLoader)#3 text =“错误 #2048:安全沙箱违规:file://{我的 .swf 的位置}无法从 {我尝试发送 HTTP POST 的位置}加载数据。” 类型=“安全错误” 时间戳 = 0 生存时间 = 0 ...
为什么 HTTP POST 在通过 Internet Explorer 加载 .SWF 文件时可以工作,但在通过 Adobe Photoshop 加载时却不起作用?
编辑:有人吗?
I am writing a Photoshop plugin as an ExtendScript (Javascript) file, that then loads up a Flash window, which I will call plugin.swf - My plugin.swf file uses an element to POST to a certain URL.
When I load plugin.swf with Internet Explorer, the HTTP POST is completed successfully.
When I load plugin.swf via the Javascript (which is called via the File -> Scripts menu of Adobe Photoshop), the HTTP POST returns the following:
...
target = (flash.net::URLLoader)#3
text = "Error #2048: Security sandbox violation: file://{location of my .swf} cannot load data from {location where I'm trying to send HTTP POST}."
type = "securityError"
timestamp = 0
timeToLive = 0
...
Why will the HTTP POST work when loading the .SWF file through Internet Explorer, but not work when loaded through Adobe Photoshop?
Edit: Anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为从文件系统加载的 swf 与 Flash 内部 Flash 播放器中加载的安全沙箱或浏览器中加载的安全沙箱不同。不确定你会如何解决这个问题;我认为策略服务器在这种情况下不会有帮助。
如果您尝试通过脚本中的 Javascript 打开一个新窗口(这将是网络上的页面 - 不是您的文件系统 - 嵌入了 swf),会发生什么?我不确定它是否会被完全忽略或使用您的默认浏览器。如果这不起作用,那么您很可能不走运。
Because a swf loaded from the filesystem has a different security sandbox than one loaded in Flash's internal flash player or one loaded in a browser. Not sure how you'd get around that issue; I don't think a policy server would help in this case.
What happens if you try to open a new window via Javascript from the script (which would be a page on the web - not your filesystem - that embedded the swf)? I'm not sure if it would be disregarded altogether or use your default browser. If that doesn't work, you're most likely out of luck.