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](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
closedattribute onWindowobjects must return true if theWindowobject’s browsing context has been discarded, and false otherwise.
If the above excerpt was not clear then it works in following conditions
window.open methodLearned on : 08-Jul-2021 Source : w3 Org#script-closable