If you’re using Firefox to block adverts, you can find the key settings you need on the same screen.
Go to Tools > Options and on the Content tab, make sure the Block popup windows box is ticked. Note that you can edit which popups are blocked via the Exceptions button.
Also on this screen, you will see the option Enable JavaScript. JavaScript support is a very useful element of webpages, and makes sites like Facebook and Google Mail so simple to use. However it is also used extensively in advertising code – as a result you might wish to disable this scripting.
On the Privacy tab, you might also wish to consider altering your Cookies settings so that they are deleted when you close Firefox or you are asked what you wish to do with them.