Is there a way to determine if the media-iframe is visible?

I came up with a way to do it:

  1. Add an element to the contents of the frame such as a text input
    with and ID (i.e. ‘search_text’)
  2. In the plugin’s CSS file, style the
    element to be visible only when it is displayed in the frame:

    #search_text {
       display: none;
    }
    
    #media-upload #search_text {
       display: inline;
    }
    
  3. Test if the element is visible:

    if(jQuery(“#search_text”).is(“:visible”)) {
    }