This looks like a dns-based solution? Most people are not going to install pihole at home. Other dns-based solutions require per-device configuration, and when you have a family with a dozen or more devices, this does not scale.
That’s why ublock origin and friends are so popular.
That's not the only reason to disable Javascript. The only way to ensure that code doesn't have any negative consequences is not to run it; post facto remedies can reduce known classes of threats significantly, but not remove threat entirely.
That’s why ublock origin and friends are so popular.