I'm following this video (https://www.youtube.com/watch?v=rymG9UmPuhM&t=535s) to create a chrome extension that looks to see if there is a specific word (or words) on the home page of youtube and then it hides the video thumbnail and title. So far with the tutorial I was able to get the title hidden, but I'm having a hard time selecting the thumbnail and changing that style.
I've found that if I were to ascend the DOM three divs to #dismissible, I could just use css to blur that entire div, but I'm having a hard time selecting that div through jquery.
I'm new to this, but here's where I'm at so far:
replaceText(document.body)
function replaceText(element) {
if (element.hasChildNodes()) {
element.childNodes.forEach(replaceText)
} else if (element.nodeType === Text.TEXT_NODE) {
if (element.textContent.match(/make/gi)) {
element.parentElement.style.color = 'black'
element.parentElement.style.backgroundColor = 'black'
}
// element.textContent = element.textContent.replace(/make/gi, 'SPOILER')
}
}