add function "window.external.isPopoverVisible()" to check if popover is visible or not.