If you open a window like:
window.open (\"url\",\"winName\",\"location=0,width=300,height=214\");
If winName is already open i
winName
I fixed this by adding
onclick="myWin = window.open('','winName','location=0,width=300,height=214'); myWin.focus()"
to the html element(button) and then change the URL via JS.