Main Page Content
Defeating The Third Voice Plug In
I've been playing around trying to figure out how to beat this plug-in. In my playing around, I've come up with a script that will render it completely useless on any page the following JavaScript is posted.How Third Voice works is to append comments to specific text at a specific URL. However, if that URL changes, the comment is no longer attached to anything relevant. So, the trick is to make sure the URL is never the same.This can be done by appending a random string to the end of the URL using the location.search object. If the URL already has the random string appended to it, change the random string and re-append. The trick is to get the script to not force the browser into an infinite loop. The easiest way to do that is to use the getTime() function which returns the number of milliseconds since January 1, 1970. Since this number is always changing, we can easily be guaranteed that the string to attach to the end of the URL is unique. If the page is loaded with a search string already attached, we simply check to see if it is within 100,000 milliseconds from the current time string created when the page is loaded. If it is more than 100,000 milliseconds the page is reloaded with the new time string appended.Here's the script. I've tested it on both IE4 and IE5 and it seems to work pretty well. Have massaged it so it won't cause any errors and won't throw the browser into a loop. Be sure to place the following script in the head section of your document of every page you want protected and you're now Thirdvoice-proof.
<script language="JavaScript" type="text/javascript"><!-- var agt = navigator.userAgent.toLowerCase(); var ie4u = ((agt.indexOf('msie') != -1) && (parseInt(navigator.appVersion) >= 4)); if(ie4u) { ts = new Date(); ts = ts.getTime(); lh = location.href; if(location.search) { ls = location.search; if(parseInt(ts) - ls.substring(1,ls.length) >= '100000') { location.href = lh.substring(0,lh.indexOf('?')) + '?' + ts; } } else { location.href = lh + '?' + ts; } }// --></script>That's all there is to it. So, for those of you who don't care to let Third Voice ruin your creations, have at it.