From RationalWiki
Jump to: navigation, search

UPDATE: Hack was undone, so this script has been obsoleted.

Quick Greasemonkey script to avoid clicking on scam links:

If you're using Greasemonkey (Firefox extension, grab it from the Mozilla Extensions site), you can just create a new script (right-click on the monkey head, enter a name like "CP Link Rewrite" and hit Okay) and replace any pre-made content with the stuff below. It's just a quick fix, so there might be bugs. Lemme know if so.

Note: If you can't use Greasemonkey (IE user, for example), but are able to edit on CP, you can try the Userscript version of this.

// ==UserScript==
// @name           CP Link Rewrite
// @namespace
// @description    Rewrite links
// @include*
// @include
// ==/UserScript==

var allElements, thisElement, bluh, blah;
allElements = document.getElementsByTagName('a');
for (var i = 0; i < allElements.length; i++)
	thisElement = allElements[i];
	if (thisElement.href.match(/index\.php/i))
		blah = thisElement.href;
		bluh = blah.split('');
		blah = bluh[0]+''+bluh[1];