One page app with popup windows

I have a one page app with the workflow “go to page” and when the user press back button, it goes back to the previous page as it is supposed to.

But, when I have popup windows in my app that also is controlled open or closed based of the URL. If I from an external page links to this URL (so that the popup is open). Then the user want to close this popup by pressing back, they go back to the external page, instead of just closing the popup inside my app. Is there a solution to this?

There is a plugin called Browser storage but I don’t understand how it can solve my problem?

I have used this plugin - Local Storage & Cookies Plugin | Bubble to get this to work. You can store the previous URL that the user has visited and accordingly check when the user closes the popup

That’s just how the browser back button works.

You could try this: have a boolean state that starts with no and in a page loaded action set that boolean to yes. In your show pop up workflow have a condition that checks that the boolean state is true/yes. In theory it should prevent the pop-up from opening if your user comes from an external page.