This question is not the duplicate of if window is popup , But a similar one.
I am developing a extension which injects scripts to all web pages. I need to detect w
I was implementing 'close' button for popup window screen and 'cancel' button for '_self' window in "Typescript/Nodejs" and believe it will work for JavaScript as well. So I needed to determine if screen is opened in a popup
if(window.opener || window.history.length === 1)
isPopupWindow = true;
else
isPopupWindow = false;
"window.opener" works for almost all the browsers but having issue with IE so to handle IE issue I used "window.history.length".