Skip to content

Instantly share code, notes, and snippets.

@chriscct7
Created August 27, 2016 18:04
Show Gist options
  • Save chriscct7/347ae1c5ce32dfb2754730a2842687cb to your computer and use it in GitHub Desktop.
Save chriscct7/347ae1c5ce32dfb2754730a2842687cb to your computer and use it in GitHub Desktop.
The danger of using _blank tags
<html>
<head></head>
<body>
<p>This is my test page: <a target="_blank" href="test.html">Click here</a></p>
<p>Note, adding rel="noopener noreferrer" into the a element will solve this problem.</p>
</body>
</html
<html>
<head></head>
<body>
This is my second test page
<script language="javascript">
window.opener.location = 'https://www.google.com'
</script>
</body>
</html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment