Definitely the second method is preferred because you don't have the overhead of another function invocation:

window.location.href = "webpage.htm";
Answer from Jacob Relkin on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › open
Window: open() method - Web APIs | MDN
If this feature is set, the new window will not have access to the originating window via Window.opener and returns null. When noopener is used, non-empty target names, other than _top, _self, and _parent, are treated like _blank in terms of deciding whether to open a new browsing context.
🌐
W3Schools
w3schools.com › jsref › met_win_open.asp
Window open() Method
The open() method opens a new browser window, or a new tab, depending on your browser settings and the parameter values.
🌐
SitePoint
sitepoint.com › javascript
Having trouble with window.open and _self - JavaScript
October 7, 2008 - if I do this: window.open(url_var,‘_self’); it works in IE but not in FF or chrome. but this: window.open(url_var); works in all 3 but opens a new window…I want to stay in the same window. Can I get a clue? THanks…
🌐
GitHub
gist.github.com › sttk › 22e74eaadde493265f38c539f3cafb37
Window open · GitHub
If this value is "_blank", opens a new window and make it target. If this value is "_self", opens no new window and make the window itself target.
🌐
CodexWorld
codexworld.com › home › how to guides › how to open url in same window and tab using javascript
How to Open URL in Same Window and Tab using JavaScript - CodexWorld
April 15, 2023 - Open URL in Same Window with JavaScript - Use window.open() method with _self to open URL in same browser tab and window using JavaScript. Example code snippet to open the URL in the same tab using JavaScript.
Find elsewhere
🌐
GitHub
github.com › whatwg › html › issues › 2636
Sort out window.opener behavior when a window.open with target targets an existing window · Issue #2636 · whatwg/html
<!DOCTYPE html> <input type="button" onclick="alert(opener + ' ' + (opener == window))" value="check opener"> <input type="button" onclick="window.open(location.href, '_self')" value="do open">
🌐
Apache Cordova
cordova.apache.org › archive › docs › en › 2.5.0 › cordova › inappbrowser › window.open.html
window.open - Apache Cordova
Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser. ... _self - opens in the Cordova WebView if url is in the white-list, else it opens in the InAppBrowser _blank - always open in the InAppBrowser _system - always open in the system web browser
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Window › opener
Window: opener property - Web APIs | MDN
April 10, 2025 - To be exact, for cross-origin opener objects, the following properties are available: window · self · location: with only the Location.replace and Location.href properties available · close · closed · focus · blur · frames · length · top · opener ·
🌐
Educative
educative.io › answers › what-is-the-windowopen-method-in-javascript
What is the window.open() method in JavaScript?
If no URL is indicated, a blank browser window will be opened. name: The name parameter is like the target attribute. It will specify if you want the new window to be one of the following: A new blank one: _blank will be used. To be loaded into the parent frame use _parent. Replace the current page use _self...
🌐
TutorialsPoint
tutorialspoint.com › target-a-window-using-javascript-or-html
Target a Window Using JavaScript or HTML
December 12, 2022 - _top ? It replaces any existing frames in order to load the webpage into the browser window using full-body. _self ? _self is the target attribute's default value by default. It opens the webpage in the same window or frame that the link was opened in.
🌐
Reality Ripple
udn.realityripple.com › docs › Web › API › Window › open
Window.open() - Web APIs
This is useful for preventing untrusted sites opened via window.open() from tampering with the originating window, and vice versa. Note that when noopener is used, nonempty target names other than _top, _self, and _parent are all treated like _blank in terms of deciding whether to open a new ...