kokokokoko / Redflagdeals Anti-referrals

// ==UserScript==
// @name         Redflagdeals Anti-referrals
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Remove referall links on RFD
// @author       You
// @match        *://forums.redflagdeals.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var Links = document.querySelectorAll('a.postlink, a.autolinker_link');

    var StripReferall = function(URL) {
        var StrippedURL = URL.split(/url=(.+)/)[1];

        try {
            return decodeURIComponent(StrippedURL);
        } catch (e) {
            return URL;
        }
    };

    Links.forEach(function(Link) {
        var ReferralURL = Link.href;
        if (ReferralURL.indexOf('url=') != -1) {
            Link.href = StripReferall(ReferralURL);
        }
    });

})();