window.open() loads a resource into a new or existing browsing context (tab, window, or named frame) (MDN). Success returns a Window reference; a blocker returns null.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call window.open. Start with this line.
JavaScript
open(url?, target?, windowFeatures?)
Call
What it does
open(url?, target?, windowFeatures?)
Primary signature.
window.open(...)
Call with the arguments your case needs.
Built into the browser. Call window.open(...) (or the global open(...)) — no import required.
Library declarations
JavaScript
open(url?, target?, windowFeatures?)
Parameters
Parameter
Description
url
Optional. Resource to load; "" / omitted → blank page
target
Optional. Context name, or _blank (default), _self, _parent, _top
Return Value
Return Value
Description
*
WindowProxy or null
JavaScript Examples
Example 1 — Basic Open
Open a blank named window from a button click.
JavaScript
// inside a click handler
const popup = window.open("", "HelpPanel", "width=600,height=400");
if (popup) {
popup.document.write("
Return. MDN: with noopener, the return value is null.
When to use. Safer for untrusted URLs you only need to open.
Example 5 — Named Window Reuse
The same target name reuses one window instead of stacking many.
JavaScript
function openHelp() {
const help = window.open("", "AppHelp", "width=500,height=400");
if (!help) return;
help.focus();
console.log("help ready");
}
// second click with "AppHelp" → same window, then focus()
One context. MDN: prefer named targets over many _blank windows.
Focus. Bring the existing window forward.
Closed? If the user closed it, the next open creates it again.
Compatibility
Browser Support
Window.open() is marked Limited availability on MDN — core opening works widely, but popup UI, features, and return values (e.g. noopener) vary.
✓ Limited availability
open()
Open browsing contexts; treat features and blockers as browser-dependent.
95%Core tag support
ChromeYes
Full core support
EdgeYes
Full core support
FirefoxYes
Full core support
SafariYes
Full core support
OperaYes
Full core support
HTML element100% supported
Bottom line: Always null-check. Prefer a user click. Test popup size and noopener in your target browsers.
Frequently Asked Questions
It loads a URL into a new or existing browsing context (tab, window, or iframe name). On success it returns a WindowProxy reference; if blocked, it returns null.
No. It is not Deprecated, Experimental, or Non-standard. MDN marks Window.open() as Limited availability because some features and popup behavior differ across browsers.
Optional url, optional target (name or _blank/_self/_parent/_top), and optional windowFeatures (comma-separated list such as popup, width, height, left, top, noopener).
The browser blocked the new context — usually a popup blocker when open() was not tied to a direct user gesture (click). Always check the return value before using it.
With noopener in windowFeatures, the new window does not get window.opener, and open() returns null. That isolates the opener from the opened page.
Prefer a normal link with target and rel when you only need navigation. Use window.open() when you need a Window reference (close, focus, size) after a user click.