Window.close() is marked Baseline Widely available on MDN (since July 2015). Browser Window API — not a Node.js built-in. Closability still depends on how the window was opened.
✓ Baseline · Widely available
close()
Close script-opened windows across modern browsers.
99%Core tag support
ChromeYes
Full support
EdgeYes
Full support
FirefoxYes
Full support
SafariYes
Full support
OperaYes
Full support
HTML element100% supported
Bottom line: API is universal; success depends on script-opened windows and user gesture / popup policy.
Frequently Asked Questions
It asks the browser to close the current window, or the Window object you call it on. It works reliably on windows your script opened (for example with window.open()).
No. Browsers block closing tabs the user opened via browser UI. close() is meant for script-opened windows. Otherwise you may see a console warning and nothing closes.
Keep the returned Window reference and call popup.close() from the opener, or call window.close() inside the popup itself.
No. Call close() with no arguments. The return value is undefined.
On a Window reference, closed becomes true after that window is shut. Check it before using the reference again.
No. MDN marks Window.close() as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.