Я разработчик Noob!Но я думаю, что это сработает для вас!
//The website you want to block
var regex = /example.com/g
// Select all anchor text from the window
var textLink = document.querySelectorAll("a");
//Check all anchor from the windows if they contain the "example.com" if they do, the href will be replace with "#"
textLink.forEach( e => {
if(regex.test(e.href)){
e.href = "#";
}});