使用 window.top.location 从画布应用程序共享对话框链接
当使用 JS SDK 共享来自应用程序的内容时,我尝试使用 window.top.location 作为链接属性。这是一个 iframe 画布应用程序。
当我发送 window.top.location 时,出现以下错误:
错误:访问属性“toJSON”源文件的权限被拒绝: http://connect.facebook.net/en_US/all.js 行:9< /p>
I还尝试传递 window.top.location 的 href 属性,但我在自己的代码中遇到类似的错误:
错误:访问属性“herf”源文件的权限被拒绝: http://localhost:2888/Scripts/quickView.js 行:65
我假设这个是一个 XSS 问题,但我想知道是否有办法解决它。我总是可以将画布页面 url 从服务器传递到客户端,但我想看看我们是否可以让它正常工作。
感谢您对此的想法。
I'm trying to use window.top.location as the link property when sharing content from an application using the JS SDK. This is an iframe canvas app.
When I send in window.top.location I get the following error:
Error: Permission denied to access property 'toJSON' Source File:
http://connect.facebook.net/en_US/all.js Line: 9
I also tried to pass in the href property of window.top.location but I get a similar error in my own code:
Error: Permission denied to access property 'herf' Source File:
http://localhost:2888/Scripts/quickView.js Line: 65
I'm assuming this is a XSS issue, but I was wondering if there was a way around it. I could always pass the canvas page url to the client from the server, but I would like to see if we can get this working instead.
Appreciate your thoughts on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
跟进有点晚了,但肖恩回避了正确的答案。仅当本地运行应用程序时才会出现此问题。在托管环境中,我可以毫无问题地访问此属性。
A little late on the follow up, but Shawn eluded to the correct answer. The issue is only present when running the application locally. In a hosted environment I can access this property without issue.