Closed LukaszGrela closed 9 years ago
@LukaszGrela this is actually fixed in PR #12, just need it to be merged in
but to answer your question, 99.99% of the time, the API object is located in the containing frameset, the window.opener or the window.opener's frameset.
I've only ever seen one instance where the SCORM API was in the course window itself.
That's my case, injecting the API into the same window as course is
Amazing, in 12 years of working with SCORM I'd never seen an instance of the API being in the course window. Then it happens twice in the same month.
I'll tell you that this is for offline mobile player:) and only to work with the Adapt courses as other courses:) were working fine in the iframe:)
I think the code probably omits the course window currently as it seems to follow the SCORM 2004 guidelines where some rules where put in place about where the API could reside, starting from the window.parent. Obviously as this wrapper is supposed to be 1.2 or 2004 it needs this little tweak to cover all bases.
The docs -- written in the last 90s and early 2000s -- were clearly aimed at framesets and pop-up windows. Personally, I've never seen an instance where the API was in the window itself. However, in this age of ajax-driven pages (built with React or other JS-based template systems), it is certainly possible for the API to be in the same window. The proposed merge makes sense and should have no impact on systems that rely on framesets. Thanks for the contribution.
Why the find method ignores the
window
object and searches inwindow.parent
orwindow.top.opener
?