我在我的网页中嵌入了一个iFrame,如下所示:
var iframeProps = {
'data-type': self.props.type,
allowTransparency: self.props.allowTransparency,
className: self.props.className,
frameBorder: self.props.frameBorder,
height: self.props.height,
key: url,
onLoad: self.props.onLoad.bind(self),
scrolling: self.props.scrolling,
src: self.state.isActive ? url : '',
style: self.props.styles,
width: self.props.width
};
<iframe {...iframeProps} />
Run Code Online (Sandbox Code Playgroud)
这在控制台中引发了错误
拒绝在框架中显示" https://twitter.com/ ...."因为祖先违反了以下内容安全策略指令:"frame-ancestors'self'".
谁能告诉我怎样才能做到这一点?
iframe ×1