getLinkElementByHREF function
Selects an LinkElement in DOM with href
.
Implementation
LinkElement? getLinkElementByHREF(String href, [String? rel]) {
if (href.isEmpty) return null;
if (isNotEmptyString(rel)) {
var resolvedURL = resolveUri(href).toString();
return getElementByValues('link', getElementHREF, [href, resolvedURL],
(e) => e.getAttribute('rel'), [rel]) as LinkElement?;
} else {
return getElementByHREF('link', href) as LinkElement?;
}
}