Embedded JavaScript Events Not running. I need your help.

  • 1 April 2020
  • 4 replies

Excuse me

I wrote the following code

first step



window.addEventListener("message", function(event) {


Second step

Looker control : Admin -> Embed -> Whitelisting the Embed Domain :

http://localhost:8010 add it, update.

third step

http://localhost:8010/demo.php running,

Look can be displayed normally in the web page.

But EventListener does not work properly, and no message is received.

what am I doing wrong? Please tell me, thank you very much.

4 replies

Userlevel 7
Badge +1

This stuff is always really hard to troubleshoot! I remember spending so long doing this when I first learned.

Your code looks fine to me.

Here’s an example of a demo (the finished HTML) that’s working fine for me right now. I’ve obfuscated some of my sso embed URL URL but the structure is all the same. It looks pretty much identical to yours, from what I can see.

window.addEventListener("message", function (event) {
if (event.source === document.getElementById("looker").contentWindow) { // confirm message came from iFrame with id Looker


<div class="container" id="header">
<center><h1>Embed Demo</h1></center>
<div id="data">
<iframe id="looker" width=500 height=500 src=;time=1585963535&amp;session_length=900&amp;external_user_id=57&amp;-------------&amp;force_logout_login=true> </iframe>

I’m not sure what could be going wrong on your side besides embed_domain issues, but maybe my example will help! I would double and triple check your embed domain.

Hi izzy

Your code helped me a lot, and I am also the sso embed URL. According to your method, it has been successful.

Thank you very much ~

How did you solve it? I tried same steps but not able to solve the problem.

Can you please guide me. @caomenglong

hi Ankit_Vishnoi:

You can use the developer tools of IE or Chrome.

Use the network monitoring function inside to see if there is an embed_domain parameter in the jump page after SSO login. The reason why I failed is that it is wrong to generate SSOURL. After the SSO login is successful, the embed_domain parameter is missing in the URL of the jumped look page.

like this


SSO After Jumped Url: