H5_0039:iframe 页面嵌套格式 安全选项sandbox

 

scrolling="no"               是否有滚动条
frameborder="no"             是否有边框
allowtransparency="yes"      是否背景透明


<iframe name="son" id="OneF" src="fwlc.html"
 style="position: absolute; width: 100%; height: 100%;"
 width="100%" height="100%" scrolling="no" frameborder="no" allowtransparency="yes" security="restricted" sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts"></iframe>


"" 应用以下所有的限制。
allow-same-origin 允许 iframe 内容被视为与包含文档有相同的来源。
allow-top-navigation 允许 iframe 内容从包含文档导航(加载)内容。
allow-forms 允许表单提交。
allow-scripts 允许脚本执行。




 

 

<iframe name="IF0" id="IF0" class="IF0" src="https://www.baidu.com/" width="100%" height="100%" scrolling="no" frameborder="no" allowtransparency="yes" security="restricted" sandbox="allow-top-navigation allow-same-origin allow-forms allow-popups allow-scripts"></iframe>

 

配置    效果
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中可以锁定鼠标,主要和鼠标锁定有关

 

posted @ 2020-04-14 19:57  琥珀君  阅读(492)  评论(0编辑  收藏  举报