How can one protect himself against this?
To a larger approximation: if a third-party chooses to share their information on your browsing habits with Facebook, that's not something you can control. But it's probably a much rarer, much smaller attack surface.