How to properly terminate SCORM 1.2 content inside iframe (ActivePresenter)?

Hello,

I am creating SCORM 1.2 packages using ActivePresenter and testing them.

When I export and run the content as standalone HTML (opened directly), window.close() works as expected.

However, when the same SCORM package is deployed in an LMS the content runs inside an iframe and window.close() does not work.

My question is:

  • Is there a proper ActivePresenter API or SCORM 1.2 method to correctly terminate/exit SCORM content running inside an iframe?

  • What is the recommended way to implement an “Exit e-content” button in this scenario?

  • Should termination be handled only through SCORM API calls instead of trying to close the window?

Any guidance would be appreciated.

Thank you.

Hi Alice,

Normally, when the learner closes the browser tab, the SCORM package will automatically call the SCORM API to terminate the session properly.

If you want to add a custom “Exit” button for learners to manually terminate the content, you can use: prez.destroy();

This method will call the SCORM API to terminate the session and also remove the SCORM content from the page so it is no longer displayed.

If you also want to try closing the browser tab/window, you can additionally use: window.top.close();

Since the content is running inside an iframe, window.top is used to access the top-level browser frame.

We do not recommend calling the SCORM API directly in custom code because it may lead to compatibility or maintenance issues later. For example, if you switch to another SCORM version in the future, the code may need to be updated accordingly. Using prez.destroy(); is recommended because ActivePresenter already handles the SCORM termination process internally.

Regards,
Hoa

1 Like