Following script will Open new window if not exist else refresh window if already exists in Javascript using window.open function.
Here is simple code:

–Open new window if not exist else refresh window if already exists in Javascript–