0

I have a website which the only element is an iFrame that render the webpage from a different domain (it needs to be like that, because the embed page was built on unbounce, but unbounce only allows 01 domain connection, and our user has already set a different domain), and this webpage embed contains a button which calls a modal (a pop-up form) from a Javascript src (meaning: once the button is clicked, it calls the javascript function which renders the pop-up, that is actually from a third domain - it's the webinarjam integration, fyi). The problem is, since they are different domains, when the iFrame tries to display the pop-up, it gets this message from the console:

  • Unsafe JavaScript attempt to initiate navigation for frame with URL '...' from frame with URL '...'. The frame attempting navigation is neither same-origin with the target, nor is it the target's parent or opener.

  • Uncaught DOMException: Failed to set the 'location' property on 'Window': The current window does not have permission to navigate the target frame to '...'. at ...

I've searched a bit but wasn't able even to find the correct terms to search for a workaround... could you please help me?

This is the website: http://produtividadepremium.com.br/webinario/ (The button which calls the pop-up is "Quero Reservar Meu Lugar Na Aula", the golden button)

Thanks.

  • 1
    Here are some suggestions: http://stackoverflow.com/questions/13042615/allowing-a-child-iframe-to-call-a-function-on-its-parent-window-from-a-different You need to communicate between the frames with [message posting API](https://developer.mozilla.org/en-US/docs/DOM/window.postMessage) and build a pop-up opening function in the parent document. – lofihelsinki Apr 12 '17 at 13:22
  • Thank you very much for replying! I'm sorry, I took a look but wasn't able to understand how to do it correctly... I think I should have mentioned that the modal, the pop-up form, is from a third domain... – Mateus Oliveira Apr 12 '17 at 13:34
  • I'm really in need of help :/ It seems that what I'm trying to achieve is possible, I just don't have the slightest idea of how – Mateus Oliveira Apr 12 '17 at 14:02
  • Can you add JavaScript to the child frame's document? If not, i'm not sure it's possible. – lofihelsinki Apr 12 '17 at 14:06
  • @lofihelsinki Yes I can. I can edit both the website and the iframe-embed webpage, I jus can't modify the script that calls the modal, since it uses src and imports the pop-up from WebinarJam. – Mateus Oliveira Apr 12 '17 at 16:58

0 Answers0