NoScript is an extension for firefox that will block javascript until you give permission to allow javascript to run
primairily for the main site (click allow) and on sites that you do not trust or think are suspicious do not allow any.
So you toggle to allow javascript for sites you trust as far as needed for the site to function,
the rest and trackers and other non-main links stay neatly blocked, also for the malcreants...
Malicious javascript run could lead to java script malware run.
Just get accustomed to the use of it and you will nver wanna be without that solid protection!
NoScript site is here:
http://noscript.net/It could be installed from here:
https://addons.mozilla.org/nl/firefox/addon/noscript/So you are secure to existing attacks and those not even thought of in the far away future....
Remember javascript is the royal road of malcode into your browser...
On Google Chrome one could use a combination of add-ons like NotScripts and Better Pop Up Blocker,
Also the additional install of AdBlocker Plus with a subscription to malware domains list will protect you,
polonus