Remove Redirects v2.0

magnusthemes:

Compatible with the original Remove Redirects, but I recommend just removing that because Tumblr doesn’t seem to use that format anymore

Purpose: Change external links from https://href.li/?https://example.com to https://example.com

Instructions

Copy and paste the code below right before </body> (may need to retype quotation marks). This uses basically zero jQuery, so it should not conflict with other things in your theme.

<script>
function noHrefLi(){
    var linkSet = document.querySelectorAll('a[href*="href.li/?"]');
    Array.prototype.forEach.call(linkSet,function(el,i){
        var theLink = linkSet[i].getAttribute('href').split("href.li/?")[1];
        linkSet[i].setAttribute("href",theLink);
    });
}
noHrefLi();
</script>

Keep reading

A useful little bit of javascript code to remove the “https://href.li/?” Tumblr adds to the beginning of URLs in external links.