sensenet

Uncaught DOMException: Blocked a frame with origin "http://localhost:8090" from accessing a cross-origin frame when I add Sensenet in iframe


I'm trying to add sensenet's document library in a iframe, when I move file to another folder, there is an error "Uncaught DOMException: Blocked a frame with origin "http://localhost:8090" from accessing a cross-origin frame.". I'm using the chrome(Version 57.0.2987.133). But If I use IE 11, it worked well, could you please give me some suggestion to fix this issue?

Stack: at Object.RefreshExploreTree (http://localhost:8090/Root/Global/scripts/sn/SN.Util.js:354:38) at Object.success (eval at (http://localhost:8090/Root/Global/scripts/jquery/jquery.js:3:4904), :22:25)


Solution

  • This error as use experienced is browser specific in some cases. As a usual solution to it using JSONP is an alternative if you are content with only GET requests. Otherwise you should implement CORS, which is the preferred solution in HTML5. You can learn more from here:

    https://benohead.com/cross-document-communication-with-iframes/

    sensenet ECM also requires a config setting for CORS, but you probably already know that:

    http://wiki.sensenet.com/Cross-origin_resource_sharing