Although Esri provides guidance on embedding a WAB app in an iframe not all WAB widgets will work in an iframe. Here are some details on problems we are having with the Splash widget:
I walked through the Javascript code for the Splash page widget. The Splash widget is trying to get the application ID from the URL. It does this when it first tries to open. Unfortunately, the way it does this will not work for an application in an iframe. I would consider it a defect in the function that ArcGIS uses to determine the URL where the widget is located.
The Splash widget’s “onOpen” function is ultimately calling a utility function to try to extract the application ID from the url:
z.getAppIdFromUrl = function() {
var b = !0
, a = window.top.location.href;
A cross-domain site in a frame can’t access those values so the browser is denying it. The utility function isn’t catching the error and behaving gracefully, so it just hangs.
You either need to not use the Splash widget, or contact Esri support and explain the issue to them, and see if it can be repaired or if there is a suggested alternative. This getAppIdFromUrl() function should be putting a try/catch block around its attempt to read the HREF and if it fails it should be falling back to trying to get the appID from elsewhere.
So where does this leave me? Any suggestions on how I can keep my WAB app in an iframe but also use the Splash widget?
Thanks,
Bernie.
We are embedding Web AppBuilder apps in story maps and the Splash widget cause the story map hang. ESRI please fix this problem.
Esri Canada support informed me that this is a bug and it was introduced with the September 2016 update to AGOL. For now my work around is to use the About widget and configure it to open at launch time.
Another workaround (for the developer version 2.2): Use the 2.1 widget and integrate it into the webapp 2.2. I tested this solution, it is operational with a webapp integrated in iframe.
I tried the <iframe> tag this morning and it looks like it works! December update must have fixed it