Close popup

Close popup

Is there a simple deluge command to close the current active popup window?

Background of my question:
A form is openen as a popup window with the openurl function
I added a deluge function on success > direct to a certain page (depending on who is logged in).
That works, however the form in the popup stays open (but blank so maybe reloads or resets).

In one case it's even worse since it starts with a stateless form, which then opens a second form, both in popups. After submit, both popups stay open and the user must click them away, so click twice. That's confusing and not user friendly.