Closing WebXR session minimizes browser on Quest2

I’m having an issue with XR sessionson Meta Quest2.
In my project the user can start a XR session by clicking a button that launches this line:, pc.XRSPACE_LOCALFLOOR);

In certain conditions I need to force the session to end and I’m using this command:;

Now the XR session is correctly ending but the browser’s window is minimized to traskbar.
How can I prevent this behaviour?

Thanks in advance.

hoping @moka might know