maloomf9 / FA Download in Browser

// ==UserScript==
// @name          FA Download in Browser
// @namespace	  http://www.furaffinity.net/maloo
// @version       0.11
// @description   Replaces download links with direct links to the content.
// @include       *://*furaffinity.net/view*
// @license       MIT
// ==/UserScript==

var links = document.querySelectorAll('a');
for (const link of links)
{
    var tar = link.href;
    if (/d\.facdn\.net\/download/.test(tar))
    {
        link.href = tar.slice(0, tar.search(/\/download/)) + tar.slice(tar.search(/\/download/) + 9, tar.length);
        //break;
    }
}