If you want to do this via Firefox, you could try using the add-on "Silent Block", I guess. I tried it out, and it seems to work although it's not well-documented.
However, I think that the original poster's idea would be a better one: change your DNS nameserver to opendns and customize your opendns settings to block unwelcome TLDs using https://store.opendns.com/get/premium-dns/. That will mean that all of your applications can take advantage of this protection, and it will be easy to set up for any other machines that you use.
(I actually run my own local DNS servers so I can easily block any TLD that I don't like, so I am not personally familiar with using customized opendns but the documentation indicates that this is easy to set up.)
Opendns’s free DNS allows you to block up to 15 top level domains. I currently block 11 now, I added CM per the suggestion in a prior post. It’s more than enough to get the bulk of the problem TLDs.
If you add these dns servers to your routers, there’s nothing you have to do on each PC. They also proactively block any known malware/virus/badguy hosts, so that’s another level of protection.
As an added bonus, there are check boxes to block the following(see below)
I crank it all the way up when I have my Nieces and Nephews over, just so they don’t accidentally wander into something foul.
Protects against all adult-related sites, illegal activity, social networking sites, video sharing sites, and general time-wasters.
26 categories in this group - View - Customize
Moderate
Protects against all adult-related sites and illegal activity.
13 categories in this group - View - Customize
Low
Protects against pornography.
4 categories in this group - View - Customize
None
Nothing blocked.
Custom
Choose the categories you want to block.