Witam, funkcja którą napisałem pobiera wszystkie linki ze strony, a następnie je odpala.
let link = document.querySelectorAll('a[href]');
link.forEach((a) => {
if(a.href.search('/categories/*/') != -1) {
window.open(a, null, "noopener");
}});
Problem mój polega na tym, że na stronie są po sobie takie same linki np. NodeList(4) [a.link1, a.link2, a.link2, a.link3]; i chciałbym, żeby jeden link otwierał się tylko raz, macie pomysł jak to zrobić?
Z góry dziękuje za pomoc! :)