Let me report a typo, missing a ) in javascript:
At the end of globalTemplate
<script>
$("*").on("click", function(e,ev) {
console.log(getUniqueSelector("#ipsLayout_footer"))
}
var element = document.querySelector('a');
function positionInNodeList(element, nodeList) {
for (var i = 0; i < nodeList.length; i++) {
if (element === nodeList[i]) {
return i;
}
}
return - 1;
}
</script>