我刚刚创建了一个带有 sandbox
属性的 iFrame。每当我尝试使用 target="_blank"
或 target="_top"
打开链接,或者尝试使用 window.open()
时,什么都不会发生。
这是我的代码:
<iframe src="http://www.google.com/"
sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts">
Apparently your browser doesn't support iFrames!
</iframe>
allow-popups
已经被记录/指定,请参见http://www.w3.org/TR/html5/browsers.html#sandboxing。 - CBroeallow-popups
关键字。” - CBroe