Please clarify how to get top frame's url via App Bridge

Hi @AndreyZienko

Can somebody explain to me how to get the current URL of the top frame?

I don’t think there’s a super clean way to do it with App-Bridge.

One of the reasons is that App-Bridge is meant to allow your app to integrate well with the web version of Shopify Admin as well as Shopify Mobile (where there might not even be an iFrame).

If you need a workaround, all the information is available on the server side - When Shopify loads your app, it provides a host query-string parameter (which is just a base64 encoding of the top-window base URL). You could use the host, your app handle, and the path of the request to construct the full URL.

Workarounds aside, any chance you can share more details about your use-case? What are you trying to achieve?
App-Bridge is designed to abstract away this piece of information, and if there’s something we missed with our design, I would love to better understand it.