|
|
Hi there, most of the facebook images have an UID tag, e.g.: it would be nice if this can be a link to the profile, e.g.: so I could use this on some of the apps I'm using at facebook - is that possible? thanks |
|
|
another "hole" in fb security, lol
|
|
|
Try this (untested - not a fb user): for (var i = 0; i < document.images.length; i++) {
var ci = document.images[i], cid;
if ((cid = ci.getAttribute('uid')) && (ci.parentNode.tagName != 'A')) {
var cl = document.createElement('a');
cl.href = 'http://www.new.facebook.com/profile.php?id=' + cid;
ci.parentNode.insertBefore(cl, ci).appendChild(ci);
}
}
|
|
|
Thanks Mikado - it works (but sometimes not, after clicking trough a couple of images)! Is it okay for you if I add this script with credits to you to Userscripts.org? |
|
|
Ok, I played a little and there is a little problem. For e.g. using the "Are you Interessted" App. Click 4-5 times the "skip" button and the images don't get linked anymore. I think its due to the reason that its all ajax. :| any ideas how to fix this? |
|
|
If it's really ajax, you just need to wrap this code into listener function: function process() {
document.body.removeEventListener('DOMNodeInserted', process, false);
// previous code
document.body.addEventListener('DOMNodeInserted', process, false);
}
process();
|
|
|
now it works like a charm. thank you very much. will put this as a script online with all credits to you pointing to this topic as well. thanks a lot again! |
|
|
once you do that GoodSoul, can you also post the link to it here? |
|
|
|