Maintain route in general page module

Hi, I’m creating an app use Atlassian Connect Express using hbs views. I’ve setup my app to be a general page and within that page I want to navigate to other pages (views). When I reload the page it redirects back to the main page which is defined in my atlassian-connect.json file.

How do you maintain the state so on a page reload it will retain the route the user was on?

I’ve tried to use the AP.history.pushState which appends a hash to the host url but within the iframe I am unable to retrieve this due to a change atlassian made in 2020 around iframe security.

Any solutions would be much appreciated.

Rich

Two years later, but I have an answer for you.

When the page loads again, on the client side you can call AP.history.getState('hash') to get the last value you called AP.history.pushState(hash) with on the previous load. Then you can navigate to that page in your iframe.

Unfortunately there is no server-side method I can find for this, which makes SSR pretty useless in a connect iframe.