AIR 应用程序:navigateToURL 引发 SecurityError #2193
我正在尝试将现有的 Web 应用程序(仅限 ActionScript 3 项目)移植到 AIR,以作为独立应用程序运行。它的功能之一是在浏览器窗口中打开网址。但是调用 navigateToURL(new URLRequest(url))
会抛出此 SecurityError:
安全错误:错误#2193:安全 沙箱违规:navigateToURL: app:/AIRDigE.swf 无法访问 http://www.youtube.com/watch?v=xCPwAr0xnGE。 在 global/flash.net::navigateToURL()
从 Flash Builder 4 运行时
谷歌搜索并不能真正帮助我解决这个特定的错误号。
Adobe 关于安全沙箱的参考 指出,任何使用 < code>Security.sandboxType==Security.APPLICATION (我的应用程序使用的)应该能够连接到任何域,但显然这对我来说并不重要。
有什么想法吗?
谢谢,弗兰克
I'm trying to port an existing web app (ActionScript 3 only project) to AIR, to run as a standalone application. One of its features is opening urls in a browser window. But calling navigateToURL(new URLRequest(url))
throws this SecurityError:
SecurityError: Error #2193: Security
sandbox violation: navigateToURL:
app:/AIRDigE.swf cannot access
http://www.youtube.com/watch?v=xCPwAr0xnGE.
at global/flash.net::navigateToURL()
when run from Flash Builder 4.
Googling doesn't really help me with this specific error number.
Adobe's reference on Security Sandboxes states that any AIR application running with Security.sandboxType==Security.APPLICATION
(which my application uses) should be able to connect to any domain, but apparently that doesn't count for me.
Any ideas?
Thanks, Frank
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
抱歉各位,今天早上我自己找到了答案:我传递到 URLRequest 的 url 前面有一个空格(它是从 xml feed 加载的,显然会产生错误的 url)。
因此,似乎是具有无效协议的 url 导致了该错误,并且在 url 周围放置
trim()
修复了该错误。Sorry folks, this morning I found the answer myself: the url that I passed into the URLRequest had a space in front of it (it was loaded from an xml feed that is evidently producing faulty urls).
So it seems that a url with an invalid protocol causes that error, and putting a
trim()
around the url fixed it.我收到此错误是因为在网络链接中使用双反斜杠,例如“http:\\www.youtube.com”,
而我应该使用“http:*//*www.youtube .com”
I was getting this error because of using double backward slashes in the web link like "http:\\www.youtube.com"
Where as I supposed to use "http:*//*www.youtube.com"
尝试将 URLRequest 与 navigatorToURL 一起使用
已更新:
try using URLRequest with navigateToURL
UPDATED: