Again, matter of taste:

return window.location.hostname.match(/localhost|127\.0\.0\.1/);

I don't really mind either way.