I want to open a link in the same window and in the same tab that contains the page with the link.
When I try to open a link by using window.open, then it opens in a new tab—not in the same tab in the same window.
You just have to use the name attribute like this:
window.open("https://www.youraddress.com","_self")
Note: Url should be prepended with the protocol. Without it tries to open the relative URL. Tested in Chrome 59, Firefox 54 and IE 11.