Condition for closing browser tab

The below excerpt is from official [w3 spec reference](https://www.w3.org/TR/html51/browsers.html#script-closable)

The below excerpt is from official w3 spec reference

A browsing context is script-closable if it is an auxiliary browsing context that was created by a script (as opposed to by an action of the user), or if it is a top-level browsing context whose session history contains only one [Document](https://html.spec.whatwg.org/multipage/dom.html#document).

The closed attribute on Window objects must return true if the Window object’s browsing context has been discarded, and false otherwise.

When does it work then

If the above excerpt was not clear then it works in following conditions


Learned on : 08-Jul-2021 Source : w3 Org#script-closable