Do you mind closing that window?

Tips and tricksIt is a well-known fact that external links can be opened in a new browser window via target="_blank". It is a little-known fact that this can cause security risks and performance issues on your own webpage.

A simple link like <a href="" target="_blank"> allows the targeted webpage to take control of your own webpage from which the link was launched (more details can be found here).

In addition, this inconspicuous little HTML attribute may also cause the performance of your own webpage to suffer if the newly opened webpage runs expensive Javascript. Jake Archibald created a demo that illustrates the performance impact.

The solution to fix both issues is to add another attribute to that same link: rel="noopener". If you are not sure whether or not your site uses _blank simply run Google’s Lighthouse test. It will tell you which links need attention.

About Uwe Kristen

After graduating in Scottish Literature at University of Glasgow in 1996 Uwe put down his empty glass and left the pub. He took the next airplane to New York City and started coding websites. He still codes. He still reads.