What I did was to simply log out from Facebook.
I would impulsively type the URL and then the small nuisance of having to log in was enough for me to close the tab. After a few days it was enough to stop the compulsion, and now I haven't used Facebook in months.
Reddit on the other hand...