I was working on something to block ads (or rather hide them) using simple javascript. For site-targeted ads using something like this:
document.querySelector("img[src*='domain.com/path/to/ad/']").style.display="none"
It actually works to find a specific image and hide it. However, Google seems to be inserting its ads in an iframe that contains its own document with a header / body / footer. It looks like this:

I could not find a way to select an adense ad and do something with it. How would you choose something in this block?
source share