As to Firefox you could install NoScript to stop scripts from running in the browser.

As to your first question, that's all over the web so I'll answer with Firewall and NoScript and leave you to read more of the web about browsers.
Bob