-
Notifications
You must be signed in to change notification settings - Fork 471
Understanding the Embed Process
What actually happens when you call powerbi.embed(element, embedConfig);
?
-
Determine if we are embedding on an element which is contains embedded content.
If the content already embedded is of the same type, we can re-use the existing iframe and simply send a new load command to it rather than reloading the entire contents of the iframe which is much slower since there is significant amount of JavaScript to download.
-
(New Embed) Create instance of embed object. (Existing Embed) Skip this step.
- The constructor of the embed will normalize all the required configuration from either the HTML attributes or those passed directly in the configuraiton object.
-
The elements content is replaced with an
<iframe>
whose src attribute is set to the embed url from the embed configuration. -
A
load
event listener is added to the iframe element. -
When the iframe is loaded the html page it calls the
embed.load
which is the next step. -
Call
embed.load
which will take the normalized load configuration which sends the loadConfiguration object (which is a subset of the embedConfiguration) to the iframe via window.postMessage. -
Send window.postMessage