Script Summary: Cleans Facebook URLs that don't actually take you to a new page only when it's disirable to do so.
Version: 1.0.3
Cleans Facebook URLs that don't actually take you to a new page only when it's disirable to do so.
Currently the script ignores the following pages on facebook:
- Photos - regex & page title
- Friends - dom/html element
- Events - dom/html element
- Groups - dom/html element
- Messages(all) - dom/html element
- Links - regex
- Notes(all) - dom/html element
- Apps/Games - dom/html element
Anyone that finds other url's i'm missing in the list above or regex tips please contact me :)
// @history 1.0.3 Cleaned up some unused code
// @history 1.0.2 Updated isTopWindow() now accepts l as a location param.
// @history 1.0.1 Fixed a console error relating to top.location == location, seems to be a bug in firefox
// @history 1.0.0 Initial release
This script is a heavily modified and hopefully improved version of Jordon Kalilich's URL cleaner script.
http://userscripts.org/scripts/show/29910
Notes to developers and future road-map:
You can use something like:
// Possible bug in firefox, using error trapping to fix this oddity with top.location == location
function isTopWindow(){
try{
if(top.location == location){
return true;
} else {
return false;
}
} catch(e){
return false;
}
}
// usage:
if(isTopWindow() != false) // do somethingThis will catch the odd error that gets thrown in the console and allow the script to continue.


