How to execute a certain JavaScript command only in the homepage of a website?

The easiest way to do that is through something like Greasemonkey.