-
Bug
-
Resolution: Fixed
-
Major
-
3.8.3
-
MOODLE_38_STABLE
-
MOODLE_310_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
After recent update of Chrome, tracking of course pages in SCORM is not been saved.
I added a comment on MDL-67175 , because the solution made there is not working properly with last chromiun browsers, but as it's closed, I've created a new one.
I think it could be solved editing mod/scorm/request.js, moving the new added block inside the catch, and removing the if clause, because the initializacion of the global var "window.mod_scorm_is_window_closing" is not working.
And I've tested that if I remove the IF and let the block as is before the try/catch, other features stop working. So it should be in the catch and act only if the sync xhr fails.
I also add some code to exclude not chromiun browsers, just in case.
try { |
httpReq.send(param);
|
} catch (e) { |
|
var pieces = navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/); |
if (pieces != null && pieces.length == 5) { |
pieces = pieces.map(piece => parseInt(piece, 10)); |
ChromeVersion = pieces[1]; |
if (ChromeVersion > 80 && FormData) { |
|
var vars = param.split('&'), |
i = 0, |
pair,
|
key,
|
value,
|
formData = new FormData(); |
|
for (i = 0; i < vars.length; i++) { |
pair = vars[i].split('='); |
key = decodeURIComponent(pair[0]); |
value = decodeURIComponent(pair[1]); |
formData.append(key, value);
|
}
|
// We'll also inform it that we are unloading, potentially useful in the future. |
formData.append('unloading', '1'); |
|
// The results is true or false, we don't get the response from the server. Make it look like it was a success. |
navigator.sendBeacon(url, formData);
|
// This is what a success looks like when it comes back from the server. |
return "true\n0"; |
}
|
}
|
return false; |
}
|
|
- Discovered while testing
-
MDL-67175 Chrome 80 support
- Closed
- has been marked as being related by
-
MDL-67989 Random SCORM failures with Chrome 80
- Open
- will help resolve
-
MDL-52569 Synchronous XMLHttpRequest on the main thread is deprecated
- Closed
-
MOBILE-3560 Scorm course doesn't resume on moodle app
- Closed