Ok, so I've been struggling with this problem for a few hours now... I need to modify the links in the search results, so that they open in a new window/tab.
Specifically it's the search results that links to a "off-site"-hit. I've created a copy of Item_WebPage.html, but I just can't get it to work.
I guess that there are some kind of async loads that screws it all up.
My js-code is as follows:
var anchors = document.getElementsByClassName('ms-srch-item-link');
for (var i = 0; i < anchors.length; i++) {
anchors[i].setAttribute("target", "_blank");
}
}
However, "anchors" always is "0". Is there a "sharepoint-document-ready-as-h*ll"-function I can use? My guess is that my problem is that not all content is loaded into the DOM before I run my code...