On Firefox (or it's forks), I usually use NoScript with custom whitelist. On Chrome, I use the TLD method suggested by moonblood here: https://www.wilderssecurity.com/showpost.php?p=2063562&postcount=3