I do userscript, which must first extract all the links by the selector, and then search only among the contents of these links, possibly changing the attributes in the found elements. Is it possible with every search not to extract all the links?
Example:
var links=document.querySelectorAll('a.some_class'); // здесь некоторые действия с атрибутами href //этот код мог бы быть решением, но не работает, как мне необходимо //селектор зависит от действий с переменной links, //то есть сразу использовать a.some_class[href$="some_href"] b нельзя links.querySelectorAll('a[href$="some_href"] b')[0].style.display='none'; //NodeList не имеет этого метода //по-другому //можно попробовать создать document fragment, у которого есть такой метод var fragment=document.createDocumentFragment(); for(var i=0; i<links.length; i++){ fragment.appendChild(links[i]); //ссылка удаляется со страницы, поэтому этот вариант тоже не подходит } You can, of course, just use the links loop, but this will be rather slow.