vue iframe 报错问题 浏览器监测到了iframe中存在不安全的链接正在尝试进行导航
报错信息如下Unsafe JavaScript attempt to initiate navigation for frame with URL ‘http://xxxx’ from frame with URL ‘http://yyyy’. The frame attempting navigation is targeting its top-level window, but is nei
·
报错信息如下
Unsafe JavaScript attempt to initiate navigation for frame with URL ‘http://xxxx’ from frame with URL ‘http://yyyy’. The frame attempting navigation is targeting its top-level window, but is neither same-origin with its target nor has it received a user gesture
在iframe加上这个代码之后 sandbox="allow-scripts allow-top-navigation allow-same-origin",
sandbox包含的属性及作用:
allow-forms :允许进行提交表单;
allow-scripts :运行执行脚本;
allow-same-origin: 允许同域请求,比如ajax,storage;
allow-top-navigation: 允许iframe能够主导window.top进行页面跳转;
allow-popups: 允许iframe中弹出新窗口,比如,window.open,target=”_blank”;
allow-pointer-lock: 在iframe中可以锁定鼠标,主要和鼠标锁定有关。
更多推荐
已为社区贡献1条内容
所有评论(0)