we can achieve this easily by looping through all links and checking which ones have a target attribute.
However, should only happen on documents that are not contained within the pop-up; hence, we check whether there is an opener document.