User:Trasamundo/monobook.js

function cbCommonsImageLinks { var els = document.getElementsByTagName('A'); var elsLen = els.length; for (i = 0; i < elsLen; i++) if (els[i].className == 'image') { var href = els[i].getAttribute('href') if (href.substring(0, 14) == '/wiki/File:') els[i].setAttribute('href', 'http://commons.wikimedia.org/wiki/File:' + href.substring(14) + '?uselang=en'); } }

$(cbCommonsImageLinks);