My Macbook (current gen, aluminum) recently started doing something weird. When I am browsing the internet on Safari or Firefox every 30 seconds to a minute a new window pops open displaying the Google. Google isn't set as my homepage so it isn't like I opened a new window normally, it only goes to Google. This only happens when I am actually doing something on the page (scrolling, typing, clicking a link) and doesn't do it when I am not touching the keyboard or touchpad.
Any ideas? I couldn't find any info searching for the problem. I tried restarting the browser but it still does it.