Is there a way of refreshing the parent page from a crm extension iframe? This is needed when the underlying record has been updated (via API's) but still showing as was until the user refreshes the record manually. In my case the card is a deal card of which a called "iframe" updates the deal value but is not visible to the user until they refresh/reaccess the record?
The History interface allows manipulation of the browser session history , that is the pages visited in the tab or frame that the current page is loaded in.
There are multiple ways to Refresh/Reload a page with jQuery/JavaScript, some are:
Have tried multiple attempts of varying combinations of .reload() including .parent.location and top.location etc. All of which seem to be blocked because of cross-domain restrictions ie iframes of a different domain can not "take control" of the parent page for the likes of url and/or reload.
Apart from an on page message requesting the user to manually refresh is there any other possibly solutions or work-arounds?
I just double checked with the team, and refreshing the parent page from a CRM Extension iframe isn't supported. The only actions from within the iframe that HubSpot supports is the window.postMessage method used to close the modal window.
I didn't go into much detail previously, but it's actually not a limitation that HubSpot enforces; it's actually due to the way the Same Origin Policy works in the browser. Because your iframe and the parent window are always going to be loaded from different places, the browser will prevent your code from refreshing the parent. That said, I'm happy to pass this feedback along to my team in case there's the potential for a workaround. I'd also recommend creating an idea in the HubSpot Ideas Forum as well, if you haven't yet.
This Stackoverflow article has some more detail; specificially, check out the comment under the top answer: