MySpace Large Pictures

By JoeSimmons Last update Oct 2, 2009 — Installed 5,050 times.

There are 3 previous versions of this script.

// ==UserScript==
// @name           MySpace Large Pictures
// @namespace      http://userscripts.org/users/23652
// @description    Changs small & medium profile pictures to large ones, even if it's private
// @include        http://*.myspace.com/*
// @include        http://myspace.com/*
// @copyright      JoeSimmons
// @version        1.0.4
// @license        Creative Commons Attribution-Noncommercial 3.0 United States License
// ==/UserScript==

var tos = new Array(),
	regex=/(\/|_)[sm](_|\.)/;

function redo(p, i) {
if(p.width>10 && p.height>10) {
p.setAttribute('width', p.width);
p.setAttribute('height', p.height);
p.src = p.src.replace(regex, '$1l$2');
clearTimeout(tos[i]);
}
else tos[i] = setTimeout(redo, 50, p, i);
}

function main() {
if(!top || top.location!=location) return;
var s_m_pics = document.evaluate("//img[contains(@src, '/m_') or contains(@src, '/s_') or contains(@src, '_s.') or contains(@src, '_m.')]",document,null,6,null);
for(var i=s_m_pics.snapshotLength-1; (item=s_m_pics.snapshotItem(i)); i--) {
if(item.width>10 && item.height>10) {
item.setAttribute('width', item.width);
item.setAttribute('height', item.height);
item.src = item.src.replace(regex, '$1l$2');
} else {
tos.length+=1;
tos[tos.length-1] = setTimeout(redo, 50, item, tos.length-1);
}
}
}

main();
window.addEventListener("DOMNodeInserted", main, false);