pull/8230/head
Yuichiro Yamashita 4 years ago
parent 3143f62f61
commit f4fcc4d6e6

@ -624,7 +624,7 @@ export default class Element extends Node {
// links with target="_blank" should have noopener or noreferrer: https://developer.chrome.com/docs/lighthouse/best-practices/external-anchors-use-rel-noopener/ // links with target="_blank" should have noopener or noreferrer: https://developer.chrome.com/docs/lighthouse/best-practices/external-anchors-use-rel-noopener/
// modern browsers add noopener by default, so we only need to check legacy browsers // modern browsers add noopener by default, so we only need to check legacy browsers
// legacy browsers don't support noopener so we only check for noreferrer there // legacy browsers don't support noopener so we only check for noreferrer there
If (component.compile_options.legacy && target_attribute && target_attribute.get_static_value() === '_blank' && href_attribute) { if (component.compile_options.legacy && target_attribute && target_attribute.get_static_value() === '_blank' && href_attribute) {
const href_static_value = href_attribute.get_static_value() ? href_attribute.get_static_value().toLowerCase() : null; const href_static_value = href_attribute.get_static_value() ? href_attribute.get_static_value().toLowerCase() : null;
if (href_static_value === null || href_static_value.match(/^(https?:)?\/\//i)) { if (href_static_value === null || href_static_value.match(/^(https?:)?\/\//i)) {

Loading…
Cancel
Save