Totara Social Open Discussions

Chrome synchronous XHR requests in page dismissal

 
Craig Eves
Re: Chrome synchronous XHR requests in page dismissal
by Craig Eves (Totara Support) - Tuesday, 21 January 2020, 12:27 PM
Group Totara

Hi Nigel

This is likely to affect some SCORM packages that save user progress -.Totara has produced a fix for this TL-22621  in the October 2019 release.

More information on how this was fixed is in the release notes 

SCORM no longer uses synchronous XHR requests for interaction

                   Chrome, in an upcoming release, will be removing the ability to make
                   synchronous XHR requests during page unload events, including beforeunload,
                   unload, pagehide and visibilitychanged.
                   If JavaScript code attempts to make such a request, the request will fail.
                   
                   This functionality is often used by SCORM to perform a last-second save of
                   the user's progress at the time the user leaves the page. Totara sends this
                   request to the server using XHR. As a consequence of the change Chrome is
                   making, the user's progress would not be saved.
                   
                   The fix introduced with this patch detects page unload events, and if the
                   SCORM package attempts to save state or communicate with the server during
                   unload, the navigation.sendBeacon API will be used (if available) instead
                   of a synchronous XHR request. The purpose of the navigation.sendBeacon API
                   is in line with this use, and it is one of two approaches recommended by
                   Chrome.
                   
                   The original timeframe for this change in Chrome was with Chrome 78 due out
                   this month. However Chrome has pushed this back now to Chrome 80. More
                   information on this change in Chrome can be found at
                   https://www.chromestatus.com/feature/4664843055398912
                   
                   We recommend all sites that make use of SCORM and who have users running
                   Chrome to update their Totara installations in advance of the Chrome 80
                   release.
regards