I had tried to implement similar blocks through uBlock Origin and similar browser addons, but this seems to be the most robust method as I use multiple different browsers on my primary computer.
Also, editing a hosts file does nothing on FB's end (which is what this article/discussion covers).