[mapguide-users] mgreact viewer: How to solve“Blocked a frame … from accessing a cross-origin frame”

Nimrod Cnaan nimcnaan at gmail.com
Thu Aug 14 09:30:01 PDT 2025


We have a MapGuide setup where the application is hosted at: https://domain
*1*.com
And  the map is served from: https://domain*2*.com

When embedding the MapGuide Viewer (reactviewer) in an <iframe> on my
application domain1, We get the following error in the browser console:
SecurityError: Failed to set a named property 'Fusion' on 'Window':
Blocked a frame with origin "https://wms.geomind.co.il" from accessing a
cross-origin frame
    at t.componentDidMount (viewer-shim.tsx:1169:14)

*p.s - It works fine under AjaxViewer*

I understand this is a browser cross-origin restriction. In my case, I
cannot simply merge the domains into one, and I need a solution to allow
the application to communicate with the viewer without getting blocked.

*My questions:*

   1.

   Is there a recommended way in MapGuide to handle cross-domain embedding
   between the application and the viewer?
   2.

   Does mgreact have a built-in API to handle postMessage communication
   between iframe and parent, or do I need to implement a custom widget?
   3.

   Is there any server-side configuration in MapGuide or Fusion that can
   bypass the window.top.Fusion assignment in viewer-shim.tsx for
   cross-origin cases?
   4.

   If I have to modify viewer-shim.tsx, what is the best practice to keep
   it compatible with future MapGuide updates?


Nimrod Cnaan
ישיר: +97248101268 | נייד: +972525355483 | nimrod at geomind.co.il

נא בקרו באתר החדש שלנו http://geomind.co.il
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20250814/f343d2b8/attachment.htm>


More information about the mapguide-users mailing list