Upvote:2

Aprove answer
var some_url = "some_url"
if(!window.open(some_url)) {
      window.location.href = some_url
}

Credit Goes to: stackoverflow.com

Related question with same questions but different answers