Is there a way to test if a form is in a popup?

I have a situation where I want to be able to have selection buttons appear next to fields in a form when the form is "popped up".  

Normally this would be the passing of an attribute, but I am looking for a more generic way to determine if the form is popped up when the RichWidgets\Popup_Editor is applied to a link?  

The reason is I want these selections to continue to appear after they navigate to another form while popped up, and I really do not want to pass around a variable, and a session variable is out of the question.

The first way that comes to mind is passing a variable as you mentioned.  Pop-ups are not typically used for things that navigate. If you navigate in a pop-up, the screen size is typically smaller and all the subsequent windows will be in that pop-up

I'm aware of how it's normally done, however, in my environment searching is very different and there are several ways to search (currently five).  Search is invoked from a number of different locations, and with so many different ways to search, I have a menu of the methods for searching.  

In the use-case I am trying to implement, there are scenarios where the user can navigate to a document view. When that happens, we want additional functionality to appear on this web page when the page is popped up, that allows the user to select a value via the document view page.