site-www icon indicating copy to clipboard operation
site-www copied to clipboard

Detect hrefs that use target="_blank" without noopener

Open Sfshaza opened this issue 8 years ago • 9 comments

For performance and security reasons: https://jakearchibald.com/2016/performance-benefits-of-rel-noopener/

We need a macro for this site and for webdev.

I found 86 instances on www.

Sfshaza avatar Nov 30 '16 16:11 Sfshaza

Same issue on webdev: https://github.com/dart-lang/site-webdev/issues/154

Sfshaza avatar Nov 30 '16 16:11 Sfshaza

(I had added the file in the original via drag/drop but didn't notice that it required a file extension. So adding the file again.)

out2.txt

Sfshaza avatar Nov 30 '16 17:11 Sfshaza

As of 2020/2/14, we still have up to 44 instances on dart.dev:

$ fgrep -R _blank src | grep target | wc -l
      76
$ fgrep -R _blank src | grep noopener | wc -l 
      32

OLD:

$ fgrep -R _blank src | grep target | wc -l
      49
$ fgrep -R _blank src | grep noopener | wc -l
       5

So up to 44 instances, but many of those are to the same site or to dartlang.org sites, and I'm not sure noopener matters for those.

kwalrath avatar Jan 30 '19 19:01 kwalrath

I think that the best solution would be to have a Jekyll plugin to handle this. (The same plugin would be useful to address issues with punctuation and the "external link" icon.)

chalin avatar Jan 30 '19 20:01 chalin

I think that 'issues with punctuation and the "external link" icon' refers to the fact that we have to include the punctuation inside the link in order for the external link icon not to move the punctuation so far to the right that it looks weird. So we end up with a lot of, say, [link text.][link text], when we'd rather have [linktext][]..

Is that right, @chalin? Did you have a specific solution in mind for that?

kwalrath avatar Jan 30 '19 20:01 kwalrath

Yes, that's it.

Did you have a specific solution in mind for that?

A Jekyll plugin.

chalin avatar Jan 30 '19 20:01 chalin

Related: #1058

kwalrath avatar Jan 31 '19 19:01 kwalrath

I'm just going to apply this fix by hand.

kwalrath avatar Feb 14 '20 21:02 kwalrath

Perhaps we should have a test for _blanks without noopener?

kwalrath avatar Feb 19 '20 17:02 kwalrath