Given src.html
:
<html>
<body>
<p>
<a href="https://stackoverflow.com" target="_blank" rel="noopener noreferrer">StackOverflow</a>
</p>
</body>
</html>
and iframe.html
<html>
<head>
<title>Test iframe</title>
</head>
<body>
<iframe sandbox="allow-scripts" src="src.html">
</iframe>
</body>
</html>
When I click StackOverflow link, it cannot open on a new tab.
- Removed
rel
attribute - Googled around this
- No console error
according to MDN documentation: iframe, the
sandbox
attribute needs to set toallow-popups
: