Array.prototype.forEach.call(document.querySelectorAll('a'), function(e){ if(e.href == (/^https:\/\/vk.com\/away.php/i) || (/^https:\/\/an.yandex.ru/i)) e.href = 'Sponsorship'; });