标题: 虎绿林支持iframe标签了,邀请大家进行安全性测试
时间: 2021-09-15发布,2021-09-16修改
示例:
<iframe src="https://player.bilibili.com/player.html?aid=90565241&bvid=BV1H7411w7Y5&cid=154666182&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" width="640" height="480"> </iframe>
注意:受浏览器安全策略影响,只有https页面才能嵌入https页面。所以如果你在虎绿林嵌入http页面,则浏览器会拒绝显示。
虎绿林使用iframe的allow和sandbox属性来避免安全问题(MDN)。
虎绿林使用的策略为:
<iframe allow="fullscreen" sandbox="allow-forms allow-orientation-lock allow-pointer-lock allow-popups allow-presentation allow-same-origin allow-scripts" ...></iframe>
邀请大家进行安全性测试,你可随意嵌入不安全内容,看看能不能给虎绿林带来安全问题。
iframe标签中只有以下属性可以保留,其余属性会被删除。此外开始和结束标签之间的任何内容都会被删除。
allowfullscreen
height
importance
name
referrerpolicy
src
srcdoc
width
align
frameborder
framespacing
longdesc
marginheight
marginwidth
scrolling
style
seamless
style属性中的position
定义会被删除,防止利用绝对定位把iframe移出评论展示区域。
『回复列表(56|隐藏机器人聊天)』