Probably because NS_BINDING_SUCCEEDED is not an error code (yes, the documentation seems to be wrong). You really want to use Components.results.NS_BINDING_ABORTED.
By the way, you seem to be comparing the hostname in the url. Given that you already have an nsIURI object, this can be done easier:
var requestHost = aSubject.QueryInterface(Components.interfaces.nsIHttpChannel).originalURI.host;
var referrerHost = aSubject.QueryInterface(Components.interfaces.nsIHttpChannel).referrer.host;
if (requestHost != referrerHost)
{
aSubject.cancel(Components.results.NS_BINDING_ABORTED);
}
source
share