Umbraco.UI icon indicating copy to clipboard operation
Umbraco.UI copied to clipboard

Links should support the `rel` attribute

Open iOvergaard opened this issue 2 years ago • 2 comments

It seems a stretch that all target=_blank links would require a rel=noreferrer attribute as they could be internal links and therefore you would lose tracking if you kept this on.

Consider adding this as a real property on all linkable elements instead, as there are a host of other values you can set in this field: rel-attribute on MDN

Originally posted by @iOvergaard in https://github.com/umbraco/Umbraco.UI/pull/715#discussion_r1463313699

iOvergaard avatar Jan 23 '24 14:01 iOvergaard

@iOvergaard target=_blank requires rel=noopener, but for some older browsers which didn't supported noopener I think noreferrer was added as well.

However for modern browsers this is actually not needed anymore. https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/noopener

Note: Setting target="_blank" on elements implicitly provides the same rel behavior as setting rel="noopener" which does not set window.opener.

bjarnef avatar Feb 05 '24 10:02 bjarnef

@bjarnef Yeah, I linked that in the original comment (must have forgotten to update this issue). We do not support older browsers, so that's why I'm saying we don't need to explicitly specify noopener. I would much rather we support setting a value for the rel attribute and people can put in whatever they want.

iOvergaard avatar Feb 05 '24 10:02 iOvergaard