I have a link which should open in a new tab, but if the tab is already open, just switch to it. I\'ve tried with javascript, wnd = window.open() and than wnd.focus(), that
In Firefox 66 and Chrome 74 this works for me:
wnd = window.wnd && window.wnd.close() || window.open(url, "wnd");
Not tested in other browsers. Thanks to roberto (in the comment of the MarkZ answer) to point me on this solution. (I could not add a comment in that answer due my lack of reputation, sorry).
window.focus() solution was not fit my needs as this other one.