I would like to hide elements which have a specific attribute inside an iframe. For example, I want to hide all elements with attribute load-ads-json-from
, and there is an element <div load-ads-json-from='//ad.server.net/some/resource'>
inside an iframe <iframe src="https://content.server.net/where/the/content/is">
.
So far I've tried ##iframe > [load-ads-json-from]
, or simply ##[load-ads-json-from]
. Both don't work. I can conditionally hide the <iframe />
entirely, based on its src
attribute, but there is useful info in the page that should not be hidden altogether.
Is there a way to do this?
##iframe > [load-ads-json-from]
isn't expected to work. However,##[load-ads-json-from]
should work. You can try to open the frame in a new tab to make it easier to debug or, in case you're using Adblock Plus, you can find which filters the extension applies using its panel in the browser's developer tools. Because it could be that a different filter interfers with this filter (e.g. by whitelisting the frame's content or disabling hiding rules for that particular domain).