Recent searches
No recent searches
Dynamic top_bar location URL
Posted Dec 20, 2023
This may end up being more of a feature request, but I'm looking to see whether there's a supported way of having a dynamic/configurable URL for the top_bar app location?
We're developing an app that will connect to an existing client that is hosted externally, however the exact external URL will vary depending on the user's chosen region. The only way I can see to do this is to change the URL at runtime.
Currently we have a top_bar app pointed at a page in the assets folder which loads a config parameter for the region so that it can redirect to the appropriate URL via location.replace(). This works, however subsequent attempts to fetch media devices from the external page then fail with "DOMException: The request is not allowed by the user agent or the platform in the current context.". This does not happen if the external URL is added directly to the manifest.json.
I've also tried using an additional iframe in the assets page and then changing the src attribute on that. This fails in a different way - the external page loads but attempts to call the ZAF client hang. For example when calling client.metadata() the promise never resolves. I'm appending the origin and app_guid query parameters to the URL, and also tried changing the origin parameter to match the parent iframe's domain, but still the same result.
Is there anything else I can try?
I've noticed that there is a "instances.create" method handler. This appears to work well however since it's restricted to only loading in the modal location it does not suit our needs. Would it be possible to allow this method to create a top_bar instance as well?
1
1 comment
sodaDreamer
Any chance of some support from the Zendesk team on this?
0
Sign in to leave a comment.