I think we should extract a helper here, for two reasons:

1. We can have this more readable (`when domain(stackexchange.com)`)
2. We can make it stricter. This also matches http://evilhacker.com/stackexchange.com/evilpage.html (are you seeing why I suggested defense in depth already ;) )

(feel free to ask me any directions if this isn't clear). I don't think this necessarily needs to happen in this pr, but please make an issue if you cannot do it here.