How can i check whether the website is already opened, if opened redirect to that tab

How can i check whether the website is already opened, if opened redirect to that tab

Tried this?
var win = window.open('http://google.com', 'tab'); if (win) { win.focus(); }