Open all item links in new tab

This commit is contained in:
Marcus Noble 2020-11-07 16:30:15 +00:00
parent bc8649fac3
commit 9db8ef59c0
1 changed files with 4 additions and 0 deletions

View File

@ -56,6 +56,10 @@ class FeedItem extends HTMLElement {
.then(item => {
template.innerHTML += item.Content || item.Description;
this.shadowRoot.appendChild(template.content.cloneNode(true));
[...this.shadowRoot.querySelectorAll('a[href^=http]')].forEach(a => {
a.setAttribute("target", "_blank");
a.setAttribute("rel", "noopener");
})
})
}