Skip to content

Understanding the Embed Process

Matt Mazzola edited this page Aug 8, 2016 · 6 revisions

Understanding the embed process

What actually happens when you call powerbi.embed(element, embedConfig);?

  1. 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.

  2. (New Embed) Create instance of embed object. (Existing Embed) Skip this step.

    1. The constructor of the embed will normalize all the required configuration from either the HTML attributes or those passed directly in the configuraiton object.
  3. The elements content is replaced with an <iframe> whose src attribute is set to the embed url from the embed configuration.

  4. A load event listener is added to the iframe element.

  5. When the iframe is loaded the html page it calls the embed.load which is the next step.

  6. 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.

  7. Send window.postMessage