I am aware there are plenty of similar questions, the only difference is I get this for two pages I serve from the **same ** domain. This can be seen in the example below.
Uncaught DOMException: Blocked a frame with origin "https://content.samba.net" from accessing a cross-origin frame.
at findAPI (https://content.samba.net/00/07/19-10/scorm_support/scorm_support.js:14:10)
at getAPI (https://content.samba.net/00/07/19-10/scorm_support/scorm_support.js:61:13)
at https://content.samba.net/00/07/19-10/SCORM.htm:200:16
Shouldn't this happen only between different domains?
============================== EDIT =======================================
Ofcourse, few seconds after I posted, I found the issue. The SCORM package has a function to locate the SCORM API. It looks at top and opener. In my case the Window Opener is in a different domain, It was trying to access that.
I'll leave it for history sake. My answer has the details.
sandbox
attribute, try addingallow-same-origin
to the value. The reason is, withoutallow-same-origin
included, browsers set the origin of the iframe to null — and a request from ahttps://content.samba.net
to a null origin is a cross-origin request. See the answers at https://mcmap.net/q/1917524/-origin-header-null-for-xhr-request-made-from-lt-iframe-gt-with-sandbox-attribute and #62289603 and for a lot more details than you probably want, see https://mcmap.net/q/18432/-when-do-browsers-send-the-origin-header-when-do-browsers-set-the-origin-to-null – Platypus