A pop-up page (“Picture in Picture”) can be closed using the standard “Close” cross in the title bar. However, this is too small especially for touch operation.
This article shows how to use a StateButton to close.
First, place a StateButton on the page. It is sufficient if it has a state. The desired image or text is then assigned to the states “-” (unknown) and “0”.
Then you add with “Events..” (context menu) enter the code to be executed when clicked: