URL Cleaner with href removal also (code inside)
![]() ![]() |
Small changes and addition of 'working' ?href= removal also:
function checkURL(event) {
if(document.location.href.indexOf('?ref=') >= 0){
location.replace(document.location.href.substring(0, document.location.href.indexOf('?ref=')));
}
var reg = /^(https?:\/\/([-a-z0-9]+\.)*facebook\.com)\/[^#]*#!(\/.*)/i;
if (reg.test(location.href)) {
document.removeEventListener('DOMNodeInserted', checkURL, true); // we need to remove the event listener or we might cause an infinite loop apparently
location.replace(location.href.replace(reg, '$1$3'));
}
}
// fire it up here
if (top.location == location && /\.facebook\.com$/i.test(location.hostname)) {
document.addEventListener('DOMNodeInserted', checkURL, true);
}
Maybe could use some tweaks, but it works any suggestions for improving? |

