Open xvlcekp opened 1 week ago
Hi @xvlcekp, the iframeManager indeed doesn’t persist the URL across window unload events. Instead of using SET_WIDGET_URL to store the new URL before redirecting, you might consider using local storage or session storage to save the URL. This way, you can retrieve it after the redirect and call SET_WIDGET_URL to initialize the sdk library as needed. Let me know if this answers your question!
Hi @xvlcekp, the iframeManager indeed doesn’t persist the URL across window unload events. Instead of using SET_WIDGET_URL to store the new URL before redirecting, you might consider using local storage or session storage to save the URL. This way, you can retrieve it after the redirect and call SET_WIDGET_URL to initialize the sdk library as needed. Let me know if this answers your question!
I'm having the same issues reported here. Unfortunately, this solution does not work on the new page as the calling extension has not been initialised.
Hi @esme thanks for your answer. The problem isn't with storing the URL, but once the iframeManager is initialized with one domain, it doesn't initialize on the other again. Setting new destinationHost is required. On the new domain it is not possible to do anyting as @Esirei mentioned, because the communication is dead.
@xvlcekp Thanks for the explanation! I don't believe we're ever setting a new destinationHost on cti.sendMessage({ type: 'SET_WIDGET_URL' })
because this sends the message to our internal SDK support library and we're not handling the message internally. Let me investigate this a little further to figure out we can resolve this
Checklist
Description I cannot figure how to redirect to a different widget URL. I assume send message of type 'SET_WIDGET_URL' doesn't work. Here is my scenario:
I set an initial URL pointing to a decision server. It retrieves the portal ID, makes the API request to get the customer's url. Before redirect, I set 'SET_WIDGET_URL' with the new URL I do the redirect to the new URL. It is very similar to the issue #18 . The URLs are in format: company1.x.com, company2.x.com, company3.x.com and so on...
Expected behavior When I send a message of type messageType.SET_WIDGET_URL, I expect the iFrameManager stores the new host, so I can do the redirect to this URL, where a calling-extensions-sdk library will be initialized.
To Reproduce I am calling this message, but it has no effect:
Screenshots/source code
Device information https://www.whatsmybrowser.org/b/UCQLI
Additional context I cleared the private information because of data protection. If you need further information, let me know.