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. |
禅道-Bee |
iframe 沙箱保护,可以参考下这两篇资料试试: https://www.w3school.com.cn/tags/att_iframe_sandbox.asp https://www.jianshu.com/p/df102bbe94b9 |
王海甘
|
已设置了sanbox属性配置,还是不行
<iframe
:src="src"
style="width:100%;height: calc(100vh - 75px);border:none"
sandbox="allow-same-origin allow-top-navigation allow-scripts allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation"
/>
|
禅道-Bee |
这样设置之后,js错误又提示什么了呢?可以截图看下。
|
王海甘
|
还是那个报错,初步分析可能的原因是,parent.location='xxx' 这个parent 不是顶层window,是第二层iframe, 这时候就无权限操作了,不知道如何解决?
|
禅道-Bee |
联系下官网顶部商务QQ,邀请加入二次开发群,可以在群里沟通确认下。
|