You can use #LibreJs to block nonfree nontrivial JavaScript while allowing JavaScript that is free and/or trivial: https://www.gnu.org/software/librejs/