How to check if a popup is open?

How to check if a popup is open?

Is there a way to determine programatically thru methods if a popup is already open on the screen?