MeidokonWiki:

// ==UserScript==
// @name        Facebook viewable download links
// @namespace   http://userscripts.org/users/0000
// @description Turn Facebook photo download links into plain non-push links
// @include     https://www.facebook.com/*
// @version     1
// @grant       GM_log
// ==/UserScript==

function changeLinks(){

        // Rewrite links
        links = document.getElementsByTagName("a");

        for (j = 0; j<links.length; j++){

                link = links[j];
                href = link.getAttribute("href");
                regExp = /\?dl=1$/;
                found = regExp.exec(href);

                if(found){
                        GM_log("Found URL: " + href);
                        link.setAttribute( "href", href.replace("?dl=1", "") );
                }
        }


        // Change "Download" to "Fullsize"
        spans = document.getElementsByTagName("span");
        for(k=0; k < spans.length; k++) {
                if (spans[k].innerHTML == "Download") {
                        spans[k].innerHTML = "Fullsize";
                }
        }
}

setInterval(function(){changeLinks();}, 2000);

MeidokonWiki: furinkan/greasemonkey/facebook_download_links (last edited 2012-10-01 06:50:23 by furinkan)