DEV Community

Discussion on: How to redirect to URL in new tab On window load event🍊

Collapse
hozefaj profile image
Hozefa • Edited on

Making sure when cross linking to another site for security reasons its better to add rel="noopener" or rel="noreferrer" would be good.

In this example, it can be like

var windowFeatures = "rel='noopener noreferrer'";

window.open("https://atulprajapati.in", '_blank', windowFeatures)

reference docs:

  1. developer.mozilla.org/en-US/docs/W...
  2. web.dev/external-anchors-use-rel-n...
Collapse
atulcodex profile image
Atul Prajapati Author

Thanks πŸ’ brother, it's something new for me 😁