You need to use the name attribute:

window.open("https://www.youraddress.com","_self")

Edit: Url should be prepended with protocol. Without it tries to open relative url. Tested in Chrome 59, Firefox 54 and IE 11.

Answer from vdbuilder on Stack Overflow
🌐
W3Schools
w3schools.com › jsref › met_win_open.asp
Window open() Method
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Discussions

launching or and getting url of window.open javascript function of a web site into webBrowser control
Well, I would launching or and getting url of window.open javascript function of a web site into webBrowser control prevent the launching into IE window. I try this and until now, the page is launching into IE window. I used c#, winform technology… More on learn.microsoft.com
🌐 learn.microsoft.com
4
0
May 8, 2021
Run javascript in window.open url field - JavaScript - SitePoint Forums | Web Development & Design Community
Hello, I just started using javascript. I am having problems with using window.open for my purpos Here is my “code” first navigate to a website window.open('http://google.com/','windowname1','width=400,height=400') Then execute this command for same window. window.open('javascript:aler... More on sitepoint.com
🌐 sitepoint.com
0
January 4, 2011
Need a link to url schema to open app store if app is not installled
This will no longer be possible in iOS9 and onwards, by design. Here's the actual commit in WebKit where this was removed: https://github.com/WebKit/webkit/commit/7bf9cb55f0cfdf9ecbefd57f168938395447d91f Safari removed this technique on purpose because people were exploiting it with ads that contained JavaScript that always redirected users to the app store, even if they didn't click on anything. For Safari, there's two solutions you can take now: Always redirect users to the App Store. If they have the app installed, they can open it from there anyway. (Recommended) Use Universal Links . It's a new feature in iOS9 where Apple links together a URL you register with your native app. You can use regular HTTP links within your hrefs and then if you have the app installed, iOS will open it automatically for you, and then the app can parse out the link to the right view. Otherwise, if you don't have the app installed, it'll just take you to the link you originally meant to go to. I wouldn't try to hack around this - Apple has very clearly stated at WWDC they don't want any hacks around custom URL schemes anymore. People have been abusing iOS APIs like canOpenURL: as basically spyware for apps, and misusing JavaScript redirection so much that they'll most likely shut down any other tricks around it. Definitely use Universal Links - it's a much better UX and it's officially sanctioned. That combined with App Links on Android means you can just build your website with regular links, and the native apps will handle any deep linking needs at the operating system level. Let me know if you have other questions! More on reddit.com
🌐 r/javascript
1
8
October 5, 2015
[Help] How do I open a new link to an external page while simultaneously sending a post request
It strikes me as really unusual to put a link inside another link - which granted since the outer one is actually a form post... it isn't actually going to be a normal link. Anyway I would instead explore writing a single bit of javascript to handle the click on the logo. The javascript can trigger the opening of the page in another tab, and then doing an ajax post to your server that it happened. More on reddit.com
🌐 r/rails
8
2
October 30, 2017
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › open
Window: open() method - Web APIs | MDN
The open() method of the Window interface loads a specified resource into a new or existing browsing context (that is, a tab, a window, or an iframe) under a specified name. ... A string indicating the URL or path of the resource to be loaded.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-open-url-in-new-tab-using-javascript
How to Open URL in New Tab using JavaScript? - GeeksforGeeks
To open a URL in a new tab using JavaScript, we can use the window.open() method. The window.open() method is used to open a new browser window or tab. It can also be used to load a specific URL in a new tab.
Published   August 21, 2025
🌐
PHPpot
phppot.com › javascript › javascript-how-to-open-url-in-new-tab
JavaScript – How to Open URL in New Tab - PHPpot
There are three ways to open a URL in a new tab. HTML anchor tags with target=_blank attribute. JavaScript window.open() to set hyperlink and target.
Find elsewhere
🌐
Zipy
zipy.ai › blog › how-to-open-a-url-in-a-new-tab-and-not-a-new-window
how to open a url in a new tab (and not a new window)
April 12, 2024 - Opening a URL in a new tab is a fundamental yet critical aspect of modern web development, crucial for enhancing user experience and engagement. Through JavaScript, specifically the window.open() method, developers have a straightforward yet ...
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 387795 › launching-or-and-getting-url-of-window-open-javasc
launching or and getting url of window.open javascript function of a web site into webBrowser control - Microsoft Q&A
May 8, 2021 - Hi marcantoineyonga-1329, You can try to use WebBrowser.InvokeScript method to call javascript function. And Sam has provided a detailed answer for it in this thread you can refer to.
🌐
Adobe Support Community
community.adobe.com › t5 › captivate-discussions › can-i-use-javascript-to-open-a-url › m-p › 13299391
Re: Can I use javascript to open a URL?
October 26, 2022 - You'll just set the success action as Execute JavaScript and put the code in the Script Window. Hopefully that helps you get going in the right direction. ... First, thank you for your suggestion. Apparently there is a popup blocker that's not permitting the page from opening.
🌐
Squash
squash.io › how-to-open-a-url-in-a-new-tab-using-javascript
How to Open a URL in a New Tab Using JavaScript
April 30, 2024 - To open a URL in a new tab using JavaScript, you can use the window.open() method. This method opens a new browser window or tab, depending on the user's browser settings.
🌐
Medium
frontendinterviewquestions.medium.com › how-to-open-a-url-in-a-new-tab-using-javascript-ea83c70d5a94
How to Open a URL in a New Tab Using JavaScript | by Pravin M | Medium
August 9, 2024 - <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Open URL in New Tab</title> <script> function openInNewTab(url) { window.open(url, '_blank'); } </script> </head> <body> <button onclick="openInNewTab('https://www.example.com')">Open Example.com in New Tab</button> </body> </html> ... The button, when clicked, triggers the openInNewTab function. You can also use JavaScript to open a URL in a new tab based on user actions like button clicks.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › XMLHttpRequest › open
XMLHttpRequest: open() method - Web APIs | MDN
June 23, 2025 - open(method, url) open(method, ... etc. Ignored for non-HTTP(S) URLs. url · A string or any other object with a stringifier — including a URL object — that provides the URL of the resource to send the request to....
🌐
PTC Community
community.ptc.com › t5 › Vuforia-Studio › How-to-open-URL-from-JS-code › td-p › 564897
How to open URL from JS code? - PTC Community
March 27, 2019 - So where Android/Chrome and IE will allow JS to invoke window.open directly Safari will not.
🌐
Mendix
community.mendix.com › link › space › app-development › questions › 121114
open url in one window with javascript action
December 26, 2022 - The Mendix Forum is the place where you can connect with Makers like you, get answers to your questions and post ideas for our product managers.
🌐
TutorialsPoint
tutorialspoint.com › how-to-open-link-in-a-new-window-javascript
How to open link in a new window using JavaScript?
September 25, 2024 - <!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href= "//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src= "https://code.jquery.com/jquery-1.12.4.js"> </script> <script src= "https://code.jquery.com/ui/1.12.1/jquery-ui.js"> </script> </head> <body> <a href="https:///www.google.com" target="popup" onclick="window.open( 'https://www.tutorialspoint.com/javascript/index.htm','popup', 'width=500,height=500'); return false;"> JavaScript Tutorial </a> </body> </html> On running this script, the browser displays the text along with a button on the webpage. When the user clicks the button, the event gets triggered and opens the URL in a new window with some specifications mentioned for that URL.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › open-a-link-without-clicking-on-it-using-javascript
How to Open a Link Without Clicking on it using JavaScript? - GeeksforGeeks
July 11, 2025 - <!DOCTYPE html> <html> <head> <title>Javascript open link without click</title> <style> .gfg { text-align: center; font-size: 40px; font-weight: bold; color: green; } </style> </head> <body> <div class="gfg" onmouseover="myFunction()"> GeeksforGeeks </div> <script> function myFunction() { window.open("https://www.geeksforgeeks.org///"); } </script> </body> </html> ... Example 2: URL is loaded into the current Window.
🌐
SitePoint
sitepoint.com › javascript
Run javascript in window.open url field - JavaScript - SitePoint Forums | Web Development & Design Community
January 4, 2011 - I am having problems with using window.open for my purpos Here is my “code” first navigate to a website window.open('http://google.com/','windowname1','width=400,height=400') Then execute this command for same window. window.open('javas...
🌐
CodexWorld
codexworld.com › home › how to guides › how to open url in new tab using javascript
How to Open URL in New Tab using JavaScript - CodexWorld
April 15, 2023 - If you want to open URL with JavaScript, the open() method of Window interface is the best option. The JavaScript window.open() method opens a new browser window.