alexrubin/Facebook-Blocker — Issue #18: More Aggressive Filtering (with code), FF8 Compatibility
Author: EvilBIll
Created: 2012-01-06 00:52:32+00:00
State: open

Interestingly, a lot of sites, e.g. the wsj.com, will hide full articles if you visit the site not logged in to facebook or have this active. You might want to add that to the notes.

Updating the install.rdf to version 8 allows it to install, and it does not crash or anything, however, blocking facebook seems to be a moving target and the code below will do a better job of blocking off off-site facebook requests and still allow one to access facebook, at least in my limited testing.

```javascript

if( ! element.src ){
//there is no src tag, don't even check the hosts
}
else if(window.location.href.toLowerCase().indexOf('facebook.com/') > 0
|| window.location.href.toLowerCase().indexOf('fbcdn.net/') > 0
){
//We are already on facebook.
return true;
}
else if( element.src.toLowerCase().indexOf('fbcdn.net/') > 0){
return false;
}
else if( element.src.toLowerCase().indexOf('facebook.com/') > 0){
return false;
}
else if( element.src.toLowerCase().indexOf('facebook.net/') > 0){
return false;
}
else if( element.src.toLowerCase().indexOf('fbshare.me') > 0){
return false;
}
else {
return true;
}
```