That happens because the site you're on has a popup ad that redirects you to the App Store. I see it most often with Candy Crush, but have seen it with other silly little games as well.
I will never play Candy Crush because of this, and any other app that uses these redirect ads goes on my blacklist as well.