User:Moviesign/common.js

var x = document.getElementsByClassName("portable-infobox")[0]; var list = x.getElementsByTagName("FIGURE"); var i; var a; var img; for (i = 0; i < list.length; i++) { a = list[i].getElementsByTagName("A")[0]; img = a.getElementsByTagName("IMG")[0]; if (img.hasAttribute("data-image-name")) { a.addEventListener("dblclick", function {           location.pathname = "/wiki/File:" + img.getAttribute("data-image-name");        }    } }