1) Checking the config option "Open external links in a new window" now also adds the 'nofollow' rel attribute to all external links, which is not documented anywhere and presents a considerable SEO impact which should be contained in a different option, not in this one.
2) The JS code for said config option has several critical issues:
2.1)
Duplicate if check.
if (drupalSettings.data.extlink.extTarget) {
// Apply the target attribute to all links.
if (drupalSettings.data.extlink.extTarget) {
2.2)
rel attribute is forced to "nofollow", overriding potentially existing other values.
After that, the rel attribute is checked for emptiness, which is impossible after the preceding "nofollow" set.
Finally, the code attempts to add the value "nofererer" to the rel attribute on several occasions, rather than "noreferrer". A typo.
$(external_links).attr({target:'_blank', rel:'nofollow'});
$(external_links).attr('rel', function (i, val) {
// If no rel attribute is present, create one with the values noopener and noreferrer.
if (val === null) {
return 'noopener nofererer';
}
Comment | File | Size | Author |
---|---|---|---|
#12 | extlink-rel-cleanup-2842020-12.patch | 11.23 KB | kekkis |
|
Comments
Comment #2
yoruvo CreditAttribution: yoruvo commentedComment #3
elachlan CreditAttribution: elachlan commentedYou are correct, this was done with SEO in mind. I have attached the related issue.
Please submit a patch and I will see about its inclusion.
Comment #4
yoruvo CreditAttribution: yoruvo commentedAttached patch created in PhpStorm with the following changes:
Comment #5
yoruvo CreditAttribution: yoruvo commentedComment #6
yoruvo CreditAttribution: yoruvo commentedI somehow fumbled the node ID in the filename; reuploading.
Comment #9
yoruvo CreditAttribution: yoruvo commentedRerolling against current dev branch, hopefully it tests this time.
Comment #10
elachlan CreditAttribution: elachlan commentedComment #12
kekkisAdding another patch, created with diff. Exactly the same as #9 otherwise.
Comment #14
elachlan CreditAttribution: elachlan commented