Strip the javascript engine out of the Tor browser, it has no reason to be there. It beats the purpose of using Tor if you're gonna allow Javascript to run.
It'd be much easier to just strip it all out, despite breaking site support in the process. Especially since Tor is usually used to access hidden services instead of the clearnet.