site-www
site-www copied to clipboard
Detect hrefs that use target="_blank" without noopener
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.
Same issue on webdev: https://github.com/dart-lang/site-webdev/issues/154
(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.)
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.
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.)
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?
Yes, that's it.
Did you have a specific solution in mind for that?
A Jekyll plugin.
Related: #1058
I'm just going to apply this fix by hand.
Perhaps we should have a test for _blanks without noopener?