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.
Most people aren't going to outright block JS either. It's a workable solution for people that block JS due to trackers (albeit not a foolproof one).
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.