iframe方式嵌入禅道,任务编辑中点击保存后出现无法跳转
iframe方式嵌入禅道,进行任务编辑,点击保存后无法正常跳转
提示iframe 沙箱保护,无法跳转,即通过parent.location=‘/zentao/task-view-2.html’无法跳转
详细信息:
task-edit-2.html:1 Unsafe JavaScript attempt to initiate navigation for frame with URL 'https://dev-bnmall.bnretail.cn/zentao/task-edit-2.html' from frame with URL 'https://dev-bnmall.bnretail.cn/zentao/task-edit-2.html'. The frame attempting navigation is sandboxed, and is therefore disallowed from navigating its ancestors.
(anonymous) @ task-edit-2.html:1
task-edit-2.html:1 Uncaught DOMException: Failed to set the 'href' property on 'Location': The current window does not have permission to navigate the target frame to '/zentao/task-view-2.html'.
at https://dev-bnmall.bnretail.cn/zentao/task-edit-2.html:1:90
iframe 沙箱保护,可以参考下这两篇资料试试:
https://www.w3school.com.cn/tags/att_iframe_sandbox.asp
https://www.jianshu.com/p/df102bbe94b9
已设置了sanbox属性配置,还是不行
还是那个报错,初步分析可能的原因是,parent.location='xxx' 这个parent 不是顶层window,是第二层iframe, 这时候就无权限操作了,不知道如何解决?