Uncaught DOMException: Blocked a frame with origin "https://local.lms-development.online" from accessing a cross-origin frame

I have a page from my lms iframed in studio. The iframed page contains javascript that trying to access the parent window in this case which is studio’s page. As a result this error is occurring since the domains are different. I read online that I can use postMessage to solve this issue but are their any alternatives. Any idea on how to solve this would be much appreciated, below is a traceback of the error. Thank you.

scormfunctions.js:38 Uncaught DOMException: Blocked a frame with origin "https://local.lms-development.online" from accessing a cross-origin frame.
    at ScanForAPI (https://local.lms-development.online//akamai/netstorage/scorm/9bcd84263f804f9e80c80d3cc6baa170/f792c4c021da74aac780e072bf16aa0ed4987767/shared/scormfunctions.js:38:16)
    at GetAPI (https://local.lms-development.online//akamai/netstorage/scorm/9bcd84263f804f9e80c80d3cc6baa170/f792c4c021da74aac780e072bf16aa0ed4987767/shared/scormfunctions.js:64:13)
    at ScormProcessInitialize (https://local.lms-development.online//akamai/netstorage/scorm/9bcd84263f804f9e80c80d3cc6baa170/f792c4c021da74aac780e072bf16aa0ed4987767/shared/scormfunctions.js:94:5)
    at doStart (https://local.lms-development.online//akamai/netstorage/scorm/9bcd84263f804f9e80c80d3cc6baa170/f792c4c021da74aac780e072bf16aa0ed4987767/shared/launchpage.html:83:9)
    at onload (https://local.lms-development.online//akamai/netstorage/scorm/9bcd84263f804f9e80c80d3cc6baa170/f792c4c021da74aac780e072bf16aa0ed4987767/shared/launchpage.html:317:89)

I believe that postMessage is the only option to do a trusted handshake between origins for cross-origin communications.

1 Like