From 218125f7cda2f35c44b7f836095e8cff9a3e965c Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Mon, 18 Oct 2021 12:51:34 +0200 Subject: [PATCH] Save content state on visibility change event --- js/h5p.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/h5p.js b/js/h5p.js index e71a0d6..33f8d6d 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -2865,11 +2865,11 @@ H5P.createTitle = function (rawTitle, maxLength) { // iPad does not support beforeunload, therefore using unload H5P.$window.one('beforeunload unload', function () { // Only want to do this once - H5P.$window.off('pagehide beforeunload unload'); + H5P.$window.off('pagehide visibilitychange beforeunload unload'); storeCurrentState(); }); // pagehide is used on iPad when tabs are switched - H5P.$window.on('pagehide', storeCurrentState); + H5P.$window.on('pagehide visibilitychange', storeCurrentState); } });