Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram not working within iframe (Read 3151 times)
FreakAzoid
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Jun 10th, 2016
Diagram not working within iframe
Jun 10th, 2016 at 8:55am
Print Post  
If we click on a diagram to expand or collapse items, it works! But it the diagram is within an iframe a security error occurs.

Is it a bug? Is it normal for mindfusion purposes?

I am using Angular2 Beta 15.
  

diagram.PNG ( 208 KB | 99 Downloads )
diagram.PNG
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3146
Joined: Oct 19th, 2005
Re: Diagram not working within iframe
Reply #1 - Jun 10th, 2016 at 9:07am
Print Post  
This happens because of same-origin security policy of browsers used to prevent XSS attacks, it doesn't seem related to the diagram itself. The error would happen if any script loaded through the IFRAME tries to access main page objects or vice-versa. You will just need to change the IFRAME's source to use the same port as the main page (e.g. 41110 instead of 16405 shown in the stack trace). For more information on same-origin policy see http://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-o...

edit: Only suspicious thing I can see in collapse method (from top of stack trace) is a reference to MindFusion.Collections, which is defined in separate common.js file. So if you need to keep the iframe on a different site, maybe check if the application loads common.js from top-level page and diagramming.js from iframe.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
FreakAzoid
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Jun 10th, 2016
Re: Diagram not working within iframe
Reply #2 - Jun 13th, 2016 at 12:45pm
Print Post  
Thank you for your answer!

The scipts are coming all from port 41110. It's a CDN for all our scripts. In the screenshot you can see that the parent page never loads the mindfusion scripts. Only the iframe loads the MindFusion.Common.js and MindFusion.Diagramming.js.

The site within the iframe should be standalone and should also be hosted in an iframe. Standalone its working.

Still the error occur.

In another browser i can see additional error infos:

Error: Permission denied to access property "expandOnIncoming" in MindFusion.Diagramming.js
  

diagram1.PNG ( 177 KB | 103 Downloads )
diagram1.PNG
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3146
Joined: Oct 19th, 2005
Re: Diagram not working within iframe
Reply #3 - Jun 13th, 2016 at 2:15pm
Print Post  
We have a bug-fix related to that property listed in 2.6 releases notes, please check if latest version fixes the exception for you -
http://mindfusion.eu/Forum/YaBB.pl?num=1464603622

The cross-domain error might be happening if some exception-handling scripts of yours load from a different port, so you might still want to look into that even if latest version fixes the original exception.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
FreakAzoid
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Jun 10th, 2016
Re: Diagram not working within iframe
Reply #4 - Jun 13th, 2016 at 2:27pm
Print Post  
Thank you ver much! The bug fix release fixes the issue! No erros occur by clicking on the diagram.
  
Back to top
 
IP Logged
 
Gravity
Junior Member
**
Offline


I Love MindFusion!

Posts: 52
Joined: Sep 21st, 2016
Re: Diagram not working within iframe
Reply #5 - Oct 7th, 2016 at 11:19am
Print Post  
i think those two lines should fix your iframe issue:

Code (Javascript)
Select All
    <meta http-equiv="X-Frame-Options" content="allow" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />

 



just in case  you are trying to implement data communication between parent and iframe page just give up
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint